mirror of
git://git.yoctoproject.org/poky.git
synced 2025-07-19 12:59:02 +02:00
recipetool: appendsrcfile(s): add a mode to update the recipe itself
Add a new option -u/--update-recipe to update the recipe itself instead of creating/updating a bbappend file (From OE-Core rev: c9a80f55ed0bf9ce249205d6a9ba670fbb7f59ba) Signed-off-by: Julien Stephan <jstephan@baylibre.com> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
parent
0ae9cf2373
commit
bc9291c5fd
|
@ -357,7 +357,9 @@ def appendsrc(args, files, rd, extralines=None):
|
|||
dry_run_outdir = dry_run_output.name
|
||||
|
||||
appendfile, _ = oe.recipeutils.bbappend_recipe(rd, args.destlayer, copyfiles, None, wildcardver=args.wildcard_version, machine=args.machine, extralines=extralines, params=params,
|
||||
redirect_output=dry_run_outdir)
|
||||
redirect_output=dry_run_outdir, update_original_recipe=args.update_recipe)
|
||||
if not appendfile:
|
||||
return
|
||||
if args.dry_run:
|
||||
output = ''
|
||||
appendfilename = os.path.basename(appendfile)
|
||||
|
@ -459,6 +461,7 @@ def register_commands(subparsers):
|
|||
help='Create/update a bbappend to add or replace source files',
|
||||
description='Creates a bbappend (or updates an existing one) to add or replace the specified file in the recipe sources, either those in WORKDIR or those in the source tree. This command lets you specify multiple files with a destination directory, so cannot specify the destination filename. See the `appendsrcfile` command for the other behavior.')
|
||||
parser.add_argument('-D', '--destdir', help='Destination directory (relative to S or WORKDIR, defaults to ".")', default='', type=destination_path)
|
||||
parser.add_argument('-u', '--update-recipe', help='Update recipe instead of creating (or updating) a bbapend file. DESTLAYER must contains the recipe to update', action='store_true')
|
||||
parser.add_argument('-n', '--dry-run', help='Dry run mode', action='store_true')
|
||||
parser.add_argument('files', nargs='+', metavar='FILE', help='File(s) to be added to the recipe sources (WORKDIR or S)', type=existing_path)
|
||||
parser.set_defaults(func=lambda a: appendsrcfiles(parser, a), parserecipes=True)
|
||||
|
@ -467,6 +470,7 @@ def register_commands(subparsers):
|
|||
parents=[common_src],
|
||||
help='Create/update a bbappend to add or replace a source file',
|
||||
description='Creates a bbappend (or updates an existing one) to add or replace the specified files in the recipe sources, either those in WORKDIR or those in the source tree. This command lets you specify the destination filename, not just destination directory, but only works for one file. See the `appendsrcfiles` command for the other behavior.')
|
||||
parser.add_argument('-u', '--update-recipe', help='Update recipe instead of creating (or updating) a bbapend file. DESTLAYER must contains the recipe to update', action='store_true')
|
||||
parser.add_argument('-n', '--dry-run', help='Dry run mode', action='store_true')
|
||||
parser.add_argument('file', metavar='FILE', help='File to be added to the recipe sources (WORKDIR or S)', type=existing_path)
|
||||
parser.add_argument('destfile', metavar='DESTFILE', nargs='?', help='Destination path (relative to S or WORKDIR, optional)', type=destination_path)
|
||||
|
|
Loading…
Reference in New Issue
Block a user