summaryrefslogtreecommitdiffstats
path: root/scripts/lib/devtool/upgrade.py
diff options
context:
space:
mode:
authorPaul Eggleton <paul.eggleton@linux.intel.com>2015-10-14 19:19:23 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2015-10-21 22:56:03 +0100
commitdb55d31dc2cc5336c09d379e5da5d2d67cc2619a (patch)
tree6367222d6efa600a7b7f417987bffe0d878b7e60 /scripts/lib/devtool/upgrade.py
parent8578bc17b54da97d42b257b3c8f398ac52b91a9f (diff)
downloadpoky-db55d31dc2cc5336c09d379e5da5d2d67cc2619a.tar.gz
devtool: handle virtual providers
For modify / extract / upgrade, if the specified "recipe" is not actually a recipe but a virtual target such as virtual/kernel, map it correctly to the actual recipe and make sure we use that name within the workspace. Thanks to Chris Larson for reminding me this was still broken and for a hint on how to fix it. (From OE-Core rev: 1f7752282ffb47d2621030ddb2fa42a5e491d6d2) Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'scripts/lib/devtool/upgrade.py')
-rw-r--r--scripts/lib/devtool/upgrade.py12
1 files changed, 9 insertions, 3 deletions
diff --git a/scripts/lib/devtool/upgrade.py b/scripts/lib/devtool/upgrade.py
index 4f850cf0e4..d38762373e 100644
--- a/scripts/lib/devtool/upgrade.py
+++ b/scripts/lib/devtool/upgrade.py
@@ -300,7 +300,13 @@ def upgrade(args, config, basepath, workspace):
300 if not rd: 300 if not rd:
301 return 1 301 return 1
302 302
303 standard._check_compatible_recipe(args.recipename, rd) 303 pn = rd.getVar('PN', True)
304 if pn != args.recipename:
305 logger.info('Mapping %s to %s' % (args.recipename, pn))
306 if pn in workspace:
307 raise DevtoolError("recipe %s is already in your workspace" % pn)
308
309 standard._check_compatible_recipe(pn, rd)
304 if rd.getVar('PV', True) == args.version and rd.getVar('SRCREV', True) == args.srcrev: 310 if rd.getVar('PV', True) == args.version and rd.getVar('SRCREV', True) == args.srcrev:
305 raise DevtoolError("Current and upgrade versions are the same version" % version) 311 raise DevtoolError("Current and upgrade versions are the same version" % version)
306 312
@@ -315,11 +321,11 @@ def upgrade(args, config, basepath, workspace):
315 _upgrade_error(e, rf, args.srctree) 321 _upgrade_error(e, rf, args.srctree)
316 except DevtoolError as e: 322 except DevtoolError as e:
317 _upgrade_error(e, rf, args.srctree) 323 _upgrade_error(e, rf, args.srctree)
318 standard._add_md5(config, args.recipename, os.path.dirname(rf)) 324 standard._add_md5(config, pn, os.path.dirname(rf))
319 325
320 af = _write_append(rf, args.srctree, args.same_dir, args.no_same_dir, rev2, 326 af = _write_append(rf, args.srctree, args.same_dir, args.no_same_dir, rev2,
321 config.workspace_path, rd) 327 config.workspace_path, rd)
322 standard._add_md5(config, args.recipename, af) 328 standard._add_md5(config, pn, af)
323 logger.info('Upgraded source extracted to %s' % args.srctree) 329 logger.info('Upgraded source extracted to %s' % args.srctree)
324 return 0 330 return 0
325 331