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:10 +0100 |
commit | 2b997c41c6476a13bf516586d56a9051aceb93ec (patch) | |
tree | 20d49cccf4ece7fbb46be7cc862a94e3e74dc383 /scripts/lib/recipetool | |
parent | f22fd77e735fc5f4a3434e3d1f567a9d7d191cf4 (diff) | |
download | openembedded-core-2b997c41c6476a13bf516586d56a9051aceb93ec.tar.gz openembedded-core-2b997c41c6476a13bf516586d56a9051aceb93ec.tar.bz2 openembedded-core-2b997c41c6476a13bf516586d56a9051aceb93ec.zip |
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.
Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Diffstat (limited to 'scripts/lib/recipetool')
-rw-r--r-- | scripts/lib/recipetool/create.py | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/scripts/lib/recipetool/create.py b/scripts/lib/recipetool/create.py index 0c413688c0..cd45998f64 100644 --- a/scripts/lib/recipetool/create.py +++ b/scripts/lib/recipetool/create.py @@ -187,9 +187,17 @@ def create_recipe(args): pn = recipefn pv = None + if args.version: + pv = args.version + + if pv and pv not in 'git svn hg'.split(): + realpv = pv + else: + realpv = None + if srcuri: - if pv and pv not in 'git svn hg'.split(): - srcuri = srcuri.replace(pv, '${PV}') + if realpv: + srcuri = srcuri.replace(realpv, '${PV}') else: lines_before.append('# No information for SRC_URI yet (only an external source tree was specified)') lines_before.append('SRC_URI = "%s"' % srcuri) @@ -201,7 +209,7 @@ def create_recipe(args): if srcuri and supports_srcrev(srcuri): lines_before.append('') lines_before.append('# Modify these as desired') - lines_before.append('PV = "1.0+git${SRCPV}"') + lines_before.append('PV = "%s+git${SRCPV}"' % (realpv or '1.0')) lines_before.append('SRCREV = "${AUTOREV}"') lines_before.append('') @@ -418,5 +426,6 @@ def register_command(subparsers): parser_create.add_argument('-o', '--outfile', help='Specify filename for recipe to create', required=True) 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('-V', '--version', help='Version to use within recipe (PV)') parser_create.set_defaults(func=create_recipe) |