summaryrefslogtreecommitdiffstats
path: root/scripts/lib/devtool/upgrade.py
diff options
context:
space:
mode:
authorJoshua Lock <joshua.g.lock@intel.com>2016-12-14 21:13:05 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2016-12-16 10:23:23 +0000
commitc0f2890c01882e9ea14e781c044f3a84f75bd0fc (patch)
tree0962d17b0bf752ba4c009fb624f044b89fd6fd87 /scripts/lib/devtool/upgrade.py
parentc4e2c59088765d1f1de7ec57cde91980f887c2ff (diff)
downloadpoky-c0f2890c01882e9ea14e781c044f3a84f75bd0fc.tar.gz
scripts: remove True option to getVar calls
getVar() now defaults to expanding by default, thus remove the True option from getVar() calls with a regex search and replace. Search made with the following regex: getVar ?\(( ?[^,()]*), True\) (From OE-Core rev: 0a36bd96e6b29fd99a296efc358ca3e9fb5af735) Signed-off-by: Joshua Lock <joshua.g.lock@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.py20
1 files changed, 10 insertions, 10 deletions
diff --git a/scripts/lib/devtool/upgrade.py b/scripts/lib/devtool/upgrade.py
index d89e9a23ac..9595f3e7a4 100644
--- a/scripts/lib/devtool/upgrade.py
+++ b/scripts/lib/devtool/upgrade.py
@@ -68,7 +68,7 @@ def _remove_patch_dirs(recipefolder):
68 shutil.rmtree(os.path.join(root,d)) 68 shutil.rmtree(os.path.join(root,d))
69 69
70def _recipe_contains(rd, var): 70def _recipe_contains(rd, var):
71 rf = rd.getVar('FILE', True) 71 rf = rd.getVar('FILE')
72 varfiles = oe.recipeutils.get_var_files(rf, [var], rd) 72 varfiles = oe.recipeutils.get_var_files(rf, [var], rd)
73 for var, fn in varfiles.items(): 73 for var, fn in varfiles.items():
74 if fn and fn.startswith(os.path.dirname(rf) + os.sep): 74 if fn and fn.startswith(os.path.dirname(rf) + os.sep):
@@ -132,7 +132,7 @@ def _write_append(rc, srctree, same_dir, no_same_dir, rev, copied, workspace, d)
132 if rev: 132 if rev:
133 f.write('# initial_rev: %s\n' % rev) 133 f.write('# initial_rev: %s\n' % rev)
134 if copied: 134 if copied:
135 f.write('# original_path: %s\n' % os.path.dirname(d.getVar('FILE', True))) 135 f.write('# original_path: %s\n' % os.path.dirname(d.getVar('FILE')))
136 f.write('# original_files: %s\n' % ' '.join(copied)) 136 f.write('# original_files: %s\n' % ' '.join(copied))
137 return af 137 return af
138 138
@@ -154,7 +154,7 @@ def _upgrade_error(e, rf, srctree):
154 raise DevtoolError(e) 154 raise DevtoolError(e)
155 155
156def _get_uri(rd): 156def _get_uri(rd):
157 srcuris = rd.getVar('SRC_URI', True).split() 157 srcuris = rd.getVar('SRC_URI').split()
158 if not len(srcuris): 158 if not len(srcuris):
159 raise DevtoolError('SRC_URI not found on recipe') 159 raise DevtoolError('SRC_URI not found on recipe')
160 # Get first non-local entry in SRC_URI - usually by convention it's 160 # Get first non-local entry in SRC_URI - usually by convention it's
@@ -185,7 +185,7 @@ def _extract_new_source(newpv, srctree, no_patch, srcrev, branch, keep_temp, tin
185 185
186 crd = rd.createCopy() 186 crd = rd.createCopy()
187 187
188 pv = crd.getVar('PV', True) 188 pv = crd.getVar('PV')
189 crd.setVar('PV', newpv) 189 crd.setVar('PV', newpv)
190 190
191 tmpsrctree = None 191 tmpsrctree = None
@@ -270,15 +270,15 @@ def _extract_new_source(newpv, srctree, no_patch, srcrev, branch, keep_temp, tin
270def _create_new_recipe(newpv, md5, sha256, srcrev, srcbranch, workspace, tinfoil, rd): 270def _create_new_recipe(newpv, md5, sha256, srcrev, srcbranch, workspace, tinfoil, rd):
271 """Creates the new recipe under workspace""" 271 """Creates the new recipe under workspace"""
272 272
273 bpn = rd.getVar('BPN', True) 273 bpn = rd.getVar('BPN')
274 path = os.path.join(workspace, 'recipes', bpn) 274 path = os.path.join(workspace, 'recipes', bpn)
275 bb.utils.mkdirhier(path) 275 bb.utils.mkdirhier(path)
276 copied, _ = oe.recipeutils.copy_recipe_files(rd, path) 276 copied, _ = oe.recipeutils.copy_recipe_files(rd, path)
277 277
278 oldpv = rd.getVar('PV', True) 278 oldpv = rd.getVar('PV')
279 if not newpv: 279 if not newpv:
280 newpv = oldpv 280 newpv = oldpv
281 origpath = rd.getVar('FILE', True) 281 origpath = rd.getVar('FILE')
282 fullpath = _rename_recipe_files(origpath, bpn, oldpv, newpv, path) 282 fullpath = _rename_recipe_files(origpath, bpn, oldpv, newpv, path)
283 logger.debug('Upgraded %s => %s' % (origpath, fullpath)) 283 logger.debug('Upgraded %s => %s' % (origpath, fullpath))
284 284
@@ -341,7 +341,7 @@ def upgrade(args, config, basepath, workspace):
341 if not rd: 341 if not rd:
342 return 1 342 return 1
343 343
344 pn = rd.getVar('PN', True) 344 pn = rd.getVar('PN')
345 if pn != args.recipename: 345 if pn != args.recipename:
346 logger.info('Mapping %s to %s' % (args.recipename, pn)) 346 logger.info('Mapping %s to %s' % (args.recipename, pn))
347 if pn in workspace: 347 if pn in workspace:
@@ -353,12 +353,12 @@ def upgrade(args, config, basepath, workspace):
353 srctree = standard.get_default_srctree(config, pn) 353 srctree = standard.get_default_srctree(config, pn)
354 354
355 standard._check_compatible_recipe(pn, rd) 355 standard._check_compatible_recipe(pn, rd)
356 old_srcrev = rd.getVar('SRCREV', True) 356 old_srcrev = rd.getVar('SRCREV')
357 if old_srcrev == 'INVALID': 357 if old_srcrev == 'INVALID':
358 old_srcrev = None 358 old_srcrev = None
359 if old_srcrev and not args.srcrev: 359 if old_srcrev and not args.srcrev:
360 raise DevtoolError("Recipe specifies a SRCREV value; you must specify a new one when upgrading") 360 raise DevtoolError("Recipe specifies a SRCREV value; you must specify a new one when upgrading")
361 if rd.getVar('PV', True) == args.version and old_srcrev == args.srcrev: 361 if rd.getVar('PV') == args.version and old_srcrev == args.srcrev:
362 raise DevtoolError("Current and upgrade versions are the same version") 362 raise DevtoolError("Current and upgrade versions are the same version")
363 363
364 rf = None 364 rf = None