From 688e0894aa664090a88614e7cf9b77acadf42940 Mon Sep 17 00:00:00 2001 From: Juan M Cruz Alcaraz Date: Fri, 8 Sep 2017 06:34:34 -0700 Subject: devtool/standard: set a preferred provider when adding a new recipe with devtool A recipe added with "devtool add" requires to be able to take precedence on recipes previously defined with PREFERRED_PROVIDER. By adding the parameter "--provides" to "devtool add" it is possible to specify an element to be provided by the recipe. A devtool recipe can override a previous PREFERRED_PROVIDER using the layer configuration file in the workspace. E.g. devtool add my-libgl git@git://my-libgl-repository --provides virtual/libgl [YOCTO #10415] (From OE-Core rev: adeea2fe6895898a5e6006e798898f0f5dabd890) Signed-off-by: Juan M Cruz Alcaraz Signed-off-by: Ross Burton Signed-off-by: Richard Purdie --- scripts/lib/recipetool/create.py | 3 +++ 1 file changed, 3 insertions(+) (limited to 'scripts/lib/recipetool/create.py') diff --git a/scripts/lib/recipetool/create.py b/scripts/lib/recipetool/create.py index 4788691cff..ca474fce99 100644 --- a/scripts/lib/recipetool/create.py +++ b/scripts/lib/recipetool/create.py @@ -699,6 +699,8 @@ def create_recipe(args): (stdout, _) = bb.process.run('git rev-parse HEAD', cwd=srctree) srcrev = stdout.rstrip() lines_before.append('SRCREV = "%s"' % srcrev) + if args.provides: + lines_before.append('PROVIDES = "%s"' % args.provides) lines_before.append('') if srcsubdir and not args.binary: @@ -1300,6 +1302,7 @@ def register_commands(subparsers): description='Creates a new recipe from a source tree') parser_create.add_argument('source', help='Path or URL to source') parser_create.add_argument('-o', '--outfile', help='Specify filename for recipe to create') + parser_create.add_argument('-p', '--provides', help='Specify an alias for the item provided by the recipe') parser_create.add_argument('-m', '--machine', help='Make recipe machine-specific as opposed to architecture-specific', action='store_true') parser_create.add_argument('-x', '--extract-to', metavar='EXTRACTPATH', help='Assuming source is a URL, fetch it and extract it to the directory specified as %(metavar)s') parser_create.add_argument('-N', '--name', help='Name to use within recipe (PN)') -- cgit v1.2.3-54-g00ecf