summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard Purdie <richard.purdie@linuxfoundation.org>2016-05-20 11:49:34 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2016-06-02 08:24:00 +0100
commit8587bce564f715e46e7317218b5c190813d3a939 (patch)
treed67f45ca7d88f1ea1dcfc436a82763fa6c39a686
parenta7309d5790f5dac46e84d3c14959943eb2496fda (diff)
downloadpoky-8587bce564f715e46e7317218b5c190813d3a939.tar.gz
classes/lib: Update to match python3 iter requirements
python3 standardises its use of iteration operations. Update the code to match the for python3 requires. (From OE-Core rev: 2476bdcbef591e951d11d57d53f1315848758571) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r--meta/classes/buildhistory.bbclass2
-rw-r--r--meta/classes/license.bbclass4
-rw-r--r--meta/classes/populate_sdk_ext.bbclass4
-rw-r--r--meta/lib/oe/buildhistory_analysis.py4
-rw-r--r--meta/lib/oe/copy_buildsystem.py2
-rw-r--r--meta/lib/oe/data.py2
-rw-r--r--meta/lib/oe/recipeutils.py8
-rw-r--r--meta/lib/oe/sstatesig.py2
-rw-r--r--meta/lib/oeqa/selftest/devtool.py2
-rw-r--r--meta/lib/oeqa/selftest/sstatetests.py4
-rw-r--r--meta/lib/oeqa/utils/decorators.py2
-rw-r--r--scripts/lib/recipetool/create_buildsys.py2
12 files changed, 19 insertions, 19 deletions
diff --git a/meta/classes/buildhistory.bbclass b/meta/classes/buildhistory.bbclass
index e3b5c44a09..cc233b5130 100644
--- a/meta/classes/buildhistory.bbclass
+++ b/meta/classes/buildhistory.bbclass
@@ -838,7 +838,7 @@ python write_srcrev() {
838 f.write('# SRCREV_%s = "%s"\n' % (name, orig_srcrev)) 838 f.write('# SRCREV_%s = "%s"\n' % (name, orig_srcrev))
839 f.write('SRCREV_%s = "%s"\n' % (name, srcrev)) 839 f.write('SRCREV_%s = "%s"\n' % (name, srcrev))
840 else: 840 else:
841 f.write('SRCREV = "%s"\n' % srcrevs.itervalues().next()) 841 f.write('SRCREV = "%s"\n' % srcrevs.values())
842 if len(tag_srcrevs) > 0: 842 if len(tag_srcrevs) > 0:
843 for name, srcrev in tag_srcrevs.items(): 843 for name, srcrev in tag_srcrevs.items():
844 f.write('# tag_%s = "%s"\n' % (name, srcrev)) 844 f.write('# tag_%s = "%s"\n' % (name, srcrev))
diff --git a/meta/classes/license.bbclass b/meta/classes/license.bbclass
index 69335d650d..538ab1976e 100644
--- a/meta/classes/license.bbclass
+++ b/meta/classes/license.bbclass
@@ -200,7 +200,7 @@ def get_deployed_dependencies(d):
200 # it might contain the bootloader. 200 # it might contain the bootloader.
201 taskdata = d.getVar("BB_TASKDEPDATA", False) 201 taskdata = d.getVar("BB_TASKDEPDATA", False)
202 depends = list(set([dep[0] for dep 202 depends = list(set([dep[0] for dep
203 in taskdata.itervalues() 203 in list(taskdata.values())
204 if not dep[0].endswith("-native")])) 204 if not dep[0].endswith("-native")]))
205 extra_depends = d.getVar("EXTRA_IMAGEDEPENDS", True) 205 extra_depends = d.getVar("EXTRA_IMAGEDEPENDS", True)
206 boot_depends = get_boot_dependencies(d) 206 boot_depends = get_boot_dependencies(d)
@@ -261,7 +261,7 @@ def get_boot_dependencies(d):
261 depends.append(dep) 261 depends.append(dep)
262 # We need to search for the provider of the dependency 262 # We need to search for the provider of the dependency
263 else: 263 else:
264 for taskdep in taskdepdata.itervalues(): 264 for taskdep in taskdepdata.values():
265 # The fifth field contains what the task provides 265 # The fifth field contains what the task provides
266 if dep in taskdep[4]: 266 if dep in taskdep[4]:
267 info_file = os.path.join( 267 info_file = os.path.join(
diff --git a/meta/classes/populate_sdk_ext.bbclass b/meta/classes/populate_sdk_ext.bbclass
index 4c3a038609..a9c6fe5933 100644
--- a/meta/classes/populate_sdk_ext.bbclass
+++ b/meta/classes/populate_sdk_ext.bbclass
@@ -45,7 +45,7 @@ def get_sdk_install_targets(d):
45 sdk_install_targets = d.getVar('SDK_TARGETS', True) 45 sdk_install_targets = d.getVar('SDK_TARGETS', True)
46 46
47 depd = d.getVar('BB_TASKDEPDATA', False) 47 depd = d.getVar('BB_TASKDEPDATA', False)
48 for v in depd.itervalues(): 48 for v in depd.values():
49 if v[1] == 'do_image_complete': 49 if v[1] == 'do_image_complete':
50 if v[0] not in sdk_install_targets: 50 if v[0] not in sdk_install_targets:
51 sdk_install_targets += ' {}'.format(v[0]) 51 sdk_install_targets += ' {}'.format(v[0])
@@ -267,7 +267,7 @@ python copy_buildsystem () {
267 # Ensure any variables set from the external environment (by way of 267 # Ensure any variables set from the external environment (by way of
268 # BB_ENV_EXTRAWHITE) are set in the SDK's configuration 268 # BB_ENV_EXTRAWHITE) are set in the SDK's configuration
269 extralines = [] 269 extralines = []
270 for name, value in env_whitelist_values.iteritems(): 270 for name, value in env_whitelist_values.items():
271 actualvalue = d.getVar(name, True) or '' 271 actualvalue = d.getVar(name, True) or ''
272 if value != actualvalue: 272 if value != actualvalue:
273 extralines.append('%s = "%s"\n' % (name, actualvalue)) 273 extralines.append('%s = "%s"\n' % (name, actualvalue))
diff --git a/meta/lib/oe/buildhistory_analysis.py b/meta/lib/oe/buildhistory_analysis.py
index 5395c768a3..0dcd49f4f1 100644
--- a/meta/lib/oe/buildhistory_analysis.py
+++ b/meta/lib/oe/buildhistory_analysis.py
@@ -62,7 +62,7 @@ class ChangeRecord:
62 62
63 def pkglist_combine(depver): 63 def pkglist_combine(depver):
64 pkglist = [] 64 pkglist = []
65 for k,v in depver.iteritems(): 65 for k,v in depver.items():
66 if v: 66 if v:
67 pkglist.append("%s (%s)" % (k,v)) 67 pkglist.append("%s (%s)" % (k,v))
68 else: 68 else:
@@ -220,7 +220,7 @@ def compare_file_lists(alines, blines):
220 adict = file_list_to_dict(alines) 220 adict = file_list_to_dict(alines)
221 bdict = file_list_to_dict(blines) 221 bdict = file_list_to_dict(blines)
222 filechanges = [] 222 filechanges = []
223 for path, splitv in adict.iteritems(): 223 for path, splitv in adict.items():
224 newsplitv = bdict.pop(path, None) 224 newsplitv = bdict.pop(path, None)
225 if newsplitv: 225 if newsplitv:
226 # Check type 226 # Check type
diff --git a/meta/lib/oe/copy_buildsystem.py b/meta/lib/oe/copy_buildsystem.py
index 7b9a0ee065..0589b7f045 100644
--- a/meta/lib/oe/copy_buildsystem.py
+++ b/meta/lib/oe/copy_buildsystem.py
@@ -124,7 +124,7 @@ class BuildSystem(object):
124def generate_locked_sigs(sigfile, d): 124def generate_locked_sigs(sigfile, d):
125 bb.utils.mkdirhier(os.path.dirname(sigfile)) 125 bb.utils.mkdirhier(os.path.dirname(sigfile))
126 depd = d.getVar('BB_TASKDEPDATA', False) 126 depd = d.getVar('BB_TASKDEPDATA', False)
127 tasks = ['%s.%s' % (v[2], v[1]) for v in depd.itervalues()] 127 tasks = ['%s.%s' % (v[2], v[1]) for v in depd.values()]
128 bb.parse.siggen.dump_lockedsigs(sigfile, tasks) 128 bb.parse.siggen.dump_lockedsigs(sigfile, tasks)
129 129
130def prune_lockedsigs(excluded_tasks, excluded_targets, lockedsigs, pruned_output): 130def prune_lockedsigs(excluded_tasks, excluded_targets, lockedsigs, pruned_output):
diff --git a/meta/lib/oe/data.py b/meta/lib/oe/data.py
index 23a9067a60..ee48950a82 100644
--- a/meta/lib/oe/data.py
+++ b/meta/lib/oe/data.py
@@ -7,7 +7,7 @@ def typed_value(key, d):
7 flags = d.getVarFlags(key) 7 flags = d.getVarFlags(key)
8 if flags is not None: 8 if flags is not None:
9 flags = dict((flag, d.expand(value)) 9 flags = dict((flag, d.expand(value))
10 for flag, value in flags.iteritems()) 10 for flag, value in list(flags.items()))
11 else: 11 else:
12 flags = {} 12 flags = {}
13 13
diff --git a/meta/lib/oe/recipeutils.py b/meta/lib/oe/recipeutils.py
index 3e17873fd8..b437720fe7 100644
--- a/meta/lib/oe/recipeutils.py
+++ b/meta/lib/oe/recipeutils.py
@@ -336,7 +336,7 @@ def patch_recipe(d, fn, varvalues, patch=False, relpath=''):
336 varfiles = get_var_files(fn, varlist, d) 336 varfiles = get_var_files(fn, varlist, d)
337 locs = localise_file_vars(fn, varfiles, varlist) 337 locs = localise_file_vars(fn, varfiles, varlist)
338 patches = [] 338 patches = []
339 for f,v in locs.iteritems(): 339 for f,v in locs.items():
340 vals = {k: varvalues[k] for k in v} 340 vals = {k: varvalues[k] for k in v}
341 patchdata = patch_recipe_file(f, vals, patch, relpath) 341 patchdata = patch_recipe_file(f, vals, patch, relpath)
342 if patch: 342 if patch:
@@ -554,7 +554,7 @@ def bbappend_recipe(rd, destlayerdir, srcfiles, install=None, wildcardver=False,
554 bbappendlines = [] 554 bbappendlines = []
555 if extralines: 555 if extralines:
556 if isinstance(extralines, dict): 556 if isinstance(extralines, dict):
557 for name, value in extralines.iteritems(): 557 for name, value in extralines.items():
558 bbappendlines.append((name, '=', value)) 558 bbappendlines.append((name, '=', value))
559 else: 559 else:
560 # Do our best to split it 560 # Do our best to split it
@@ -594,7 +594,7 @@ def bbappend_recipe(rd, destlayerdir, srcfiles, install=None, wildcardver=False,
594 copyfiles = {} 594 copyfiles = {}
595 if srcfiles: 595 if srcfiles:
596 instfunclines = [] 596 instfunclines = []
597 for newfile, origsrcfile in srcfiles.iteritems(): 597 for newfile, origsrcfile in srcfiles.items():
598 srcfile = origsrcfile 598 srcfile = origsrcfile
599 srcurientry = None 599 srcurientry = None
600 if not srcfile: 600 if not srcfile:
@@ -717,7 +717,7 @@ def bbappend_recipe(rd, destlayerdir, srcfiles, install=None, wildcardver=False,
717 if copyfiles: 717 if copyfiles:
718 if machine: 718 if machine:
719 destsubdir = os.path.join(destsubdir, machine) 719 destsubdir = os.path.join(destsubdir, machine)
720 for newfile, srcfile in copyfiles.iteritems(): 720 for newfile, srcfile in copyfiles.items():
721 filedest = os.path.join(appenddir, destsubdir, os.path.basename(srcfile)) 721 filedest = os.path.join(appenddir, destsubdir, os.path.basename(srcfile))
722 if os.path.abspath(newfile) != os.path.abspath(filedest): 722 if os.path.abspath(newfile) != os.path.abspath(filedest):
723 bb.note('Copying %s to %s' % (newfile, filedest)) 723 bb.note('Copying %s to %s' % (newfile, filedest))
diff --git a/meta/lib/oe/sstatesig.py b/meta/lib/oe/sstatesig.py
index 01dce660cf..500122d461 100644
--- a/meta/lib/oe/sstatesig.py
+++ b/meta/lib/oe/sstatesig.py
@@ -220,7 +220,7 @@ class SignatureGeneratorOEBasicHash(bb.siggen.SignatureGeneratorBasicHash):
220 for task in range(len(sq_fn)): 220 for task in range(len(sq_fn)):
221 if task not in ret: 221 if task not in ret:
222 for pn in self.lockedsigs: 222 for pn in self.lockedsigs:
223 if sq_hash[task] in self.lockedsigs[pn].itervalues(): 223 if sq_hash[task] in iter(self.lockedsigs[pn].values()):
224 if sq_task[task] == 'do_shared_workdir': 224 if sq_task[task] == 'do_shared_workdir':
225 continue 225 continue
226 sstate_missing_msgs.append("Locked sig is set for %s:%s (%s) yet not in sstate cache?" 226 sstate_missing_msgs.append("Locked sig is set for %s:%s (%s) yet not in sstate cache?"
diff --git a/meta/lib/oeqa/selftest/devtool.py b/meta/lib/oeqa/selftest/devtool.py
index b64f9b3e76..6d2417ee4f 100644
--- a/meta/lib/oeqa/selftest/devtool.py
+++ b/meta/lib/oeqa/selftest/devtool.py
@@ -50,7 +50,7 @@ class DevtoolBase(oeSelfTest):
50 50
51 51
52 missingvars = {} 52 missingvars = {}
53 for var, value in checkvars.iteritems(): 53 for var, value in checkvars.items():
54 if value is not None: 54 if value is not None:
55 missingvars[var] = value 55 missingvars[var] = value
56 self.assertEqual(missingvars, {}, 'Some expected variables not found in recipe: %s' % checkvars) 56 self.assertEqual(missingvars, {}, 'Some expected variables not found in recipe: %s' % checkvars)
diff --git a/meta/lib/oeqa/selftest/sstatetests.py b/meta/lib/oeqa/selftest/sstatetests.py
index a1e5d33580..cc64c6cb68 100644
--- a/meta/lib/oeqa/selftest/sstatetests.py
+++ b/meta/lib/oeqa/selftest/sstatetests.py
@@ -445,14 +445,14 @@ http_proxy = "http://example.com/"
445 files1 = get_files(topdir + "/tmp-sstatesamehash/stamps/") 445 files1 = get_files(topdir + "/tmp-sstatesamehash/stamps/")
446 files2 = get_files(topdir + "/tmp-sstatesamehash2/stamps/") 446 files2 = get_files(topdir + "/tmp-sstatesamehash2/stamps/")
447 # Remove items that are identical in both sets 447 # Remove items that are identical in both sets
448 for k,v in files1.viewitems() & files2.viewitems(): 448 for k,v in files1.items() & files2.items():
449 del files1[k] 449 del files1[k]
450 del files2[k] 450 del files2[k]
451 if not files1 and not files2: 451 if not files1 and not files2:
452 # No changes, so we're done 452 # No changes, so we're done
453 return 453 return
454 454
455 for k in files1.viewkeys() | files2.viewkeys(): 455 for k in files1.keys() | files2.keys():
456 if k in files1 and k in files2: 456 if k in files1 and k in files2:
457 print("%s differs:" % k) 457 print("%s differs:" % k)
458 print(subprocess.check_output(("bitbake-diffsigs", 458 print(subprocess.check_output(("bitbake-diffsigs",
diff --git a/meta/lib/oeqa/utils/decorators.py b/meta/lib/oeqa/utils/decorators.py
index d52f326f1a..6fb09db417 100644
--- a/meta/lib/oeqa/utils/decorators.py
+++ b/meta/lib/oeqa/utils/decorators.py
@@ -215,7 +215,7 @@ def tag(*args, **kwargs):
215 def wrap_ob(ob): 215 def wrap_ob(ob):
216 for name in args: 216 for name in args:
217 setattr(ob, __tag_prefix + name, True) 217 setattr(ob, __tag_prefix + name, True)
218 for name, value in kwargs.iteritems(): 218 for name, value in kwargs.items():
219 setattr(ob, __tag_prefix + name, value) 219 setattr(ob, __tag_prefix + name, value)
220 return ob 220 return ob
221 return wrap_ob 221 return wrap_ob
diff --git a/scripts/lib/recipetool/create_buildsys.py b/scripts/lib/recipetool/create_buildsys.py
index 37d161ef0f..ad857801d3 100644
--- a/scripts/lib/recipetool/create_buildsys.py
+++ b/scripts/lib/recipetool/create_buildsys.py
@@ -840,7 +840,7 @@ class SpecFileRecipeHandler(RecipeHandler):
840 linecount = 0 840 linecount = 0
841 with open(fileitem, 'r') as f: 841 with open(fileitem, 'r') as f:
842 for line in f: 842 for line in f:
843 for value, varname in valuemap.iteritems(): 843 for value, varname in valuemap.items():
844 if line.startswith(value + ':') and not varname in foundvalues: 844 if line.startswith(value + ':') and not varname in foundvalues:
845 foundvalues[varname] = line.split(':', 1)[1].strip() 845 foundvalues[varname] = line.split(':', 1)[1].strip()
846 break 846 break