diff options
author | Paul Eggleton <paul.eggleton@linux.intel.com> | 2015-04-28 17:07:31 +0100 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2015-05-01 17:08:50 +0100 |
commit | 4502daefb8f6da31f3fe9f0e8d34d0a5d667640e (patch) | |
tree | 28e088544075be718d53f583947cfaed155876cf /scripts/lib/devtool | |
parent | 266ea28183516646195226c9ac3297a5f45d3834 (diff) | |
download | poky-4502daefb8f6da31f3fe9f0e8d34d0a5d667640e.tar.gz |
devtool: add: use the appropriate file naming and versioning for SCM recipes
* Recipes that fetch from git, svn or hg by OpenEmbedded convention
should normally be named with this as a suffix, since PV is meant to
be set appropriately within the recipe, so follow this. In order to
make this work we need to be able to have the version independent from
the file name, so add a -V option to recipetool create to allow this
to be specified.
* If -V is specified on the devtool add command line, ensure at PV gets
set to include this version.
(From OE-Core rev: 2b997c41c6476a13bf516586d56a9051aceb93ec)
Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'scripts/lib/devtool')
-rw-r--r-- | scripts/lib/devtool/standard.py | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/scripts/lib/devtool/standard.py b/scripts/lib/devtool/standard.py index 06b184bca5..cb4b57be92 100644 --- a/scripts/lib/devtool/standard.py +++ b/scripts/lib/devtool/standard.py | |||
@@ -65,11 +65,21 @@ def add(args, config, basepath, workspace): | |||
65 | 65 | ||
66 | recipedir = os.path.join(config.workspace_path, 'recipes', args.recipename) | 66 | recipedir = os.path.join(config.workspace_path, 'recipes', args.recipename) |
67 | bb.utils.mkdirhier(recipedir) | 67 | bb.utils.mkdirhier(recipedir) |
68 | rfv = None | ||
68 | if args.version: | 69 | if args.version: |
69 | if '_' in args.version or ' ' in args.version: | 70 | if '_' in args.version or ' ' in args.version: |
70 | logger.error('Invalid version string "%s"' % args.version) | 71 | logger.error('Invalid version string "%s"' % args.version) |
71 | return -1 | 72 | return -1 |
72 | bp = "%s_%s" % (args.recipename, args.version) | 73 | rfv = args.version |
74 | if args.fetch: | ||
75 | if args.fetch.startswith('git://'): | ||
76 | rfv = 'git' | ||
77 | elif args.fetch.startswith('svn://'): | ||
78 | rfv = 'svn' | ||
79 | elif args.fetch.startswith('hg://'): | ||
80 | rfv = 'hg' | ||
81 | if rfv: | ||
82 | bp = "%s_%s" % (args.recipename, rfv) | ||
73 | else: | 83 | else: |
74 | bp = args.recipename | 84 | bp = args.recipename |
75 | recipefile = os.path.join(recipedir, "%s.bb" % bp) | 85 | recipefile = os.path.join(recipedir, "%s.bb" % bp) |
@@ -83,6 +93,8 @@ def add(args, config, basepath, workspace): | |||
83 | extracmdopts = '-x %s' % srctree | 93 | extracmdopts = '-x %s' % srctree |
84 | else: | 94 | else: |
85 | source = srctree | 95 | source = srctree |
96 | if args.version: | ||
97 | extracmdopts += ' -V %s' % args.version | ||
86 | stdout, stderr = exec_build_env_command(config.init_path, basepath, 'recipetool --color=%s create -o %s "%s" %s' % (color, recipefile, source, extracmdopts)) | 98 | stdout, stderr = exec_build_env_command(config.init_path, basepath, 'recipetool --color=%s create -o %s "%s" %s' % (color, recipefile, source, extracmdopts)) |
87 | logger.info('Recipe %s has been automatically created; further editing may be required to make it fully functional' % recipefile) | 99 | logger.info('Recipe %s has been automatically created; further editing may be required to make it fully functional' % recipefile) |
88 | 100 | ||