aboutsummaryrefslogtreecommitdiffstats
path: root/scripts/lib/devtool
diff options
context:
space:
mode:
authorPaul Eggleton <paul.eggleton@linux.intel.com>2015-04-28 17:07:31 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2015-05-01 17:08:10 +0100
commit2b997c41c6476a13bf516586d56a9051aceb93ec (patch)
tree20d49cccf4ece7fbb46be7cc862a94e3e74dc383 /scripts/lib/devtool
parentf22fd77e735fc5f4a3434e3d1f567a9d7d191cf4 (diff)
downloadopenembedded-core-contrib-2b997c41c6476a13bf516586d56a9051aceb93ec.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. Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Diffstat (limited to 'scripts/lib/devtool')
-rw-r--r--scripts/lib/devtool/standard.py14
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):
recipedir = os.path.join(config.workspace_path, 'recipes', args.recipename)
bb.utils.mkdirhier(recipedir)
+ rfv = None
if args.version:
if '_' in args.version or ' ' in args.version:
logger.error('Invalid version string "%s"' % args.version)
return -1
- bp = "%s_%s" % (args.recipename, args.version)
+ rfv = args.version
+ if args.fetch:
+ if args.fetch.startswith('git://'):
+ rfv = 'git'
+ elif args.fetch.startswith('svn://'):
+ rfv = 'svn'
+ elif args.fetch.startswith('hg://'):
+ rfv = 'hg'
+ if rfv:
+ bp = "%s_%s" % (args.recipename, rfv)
else:
bp = args.recipename
recipefile = os.path.join(recipedir, "%s.bb" % bp)
@@ -83,6 +93,8 @@ def add(args, config, basepath, workspace):
extracmdopts = '-x %s' % srctree
else:
source = srctree
+ if args.version:
+ extracmdopts += ' -V %s' % args.version
stdout, stderr = exec_build_env_command(config.init_path, basepath, 'recipetool --color=%s create -o %s "%s" %s' % (color, recipefile, source, extracmdopts))
logger.info('Recipe %s has been automatically created; further editing may be required to make it fully functional' % recipefile)