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:10:02 +0100
commit2476bdcbef591e951d11d57d53f1315848758571 (patch)
tree8ad30b8cded6c8bd3370cf99813b2a4f4791d127
parentbb4685af1bffe17b3aa92a6d21398f38a44ea874 (diff)
downloadopenembedded-core-contrib-2476bdcbef591e951d11d57d53f1315848758571.tar.gz
openembedded-core-contrib-2476bdcbef591e951d11d57d53f1315848758571.tar.bz2
openembedded-core-contrib-2476bdcbef591e951d11d57d53f1315848758571.zip
classes/lib: Update to match python3 iter requirements
python3 standardises its use of iteration operations. Update the code to match the for python3 requires. 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() {
f.write('# SRCREV_%s = "%s"\n' % (name, orig_srcrev))
f.write('SRCREV_%s = "%s"\n' % (name, srcrev))
else:
- f.write('SRCREV = "%s"\n' % srcrevs.itervalues().next())
+ f.write('SRCREV = "%s"\n' % srcrevs.values())
if len(tag_srcrevs) > 0:
for name, srcrev in tag_srcrevs.items():
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):
# it might contain the bootloader.
taskdata = d.getVar("BB_TASKDEPDATA", False)
depends = list(set([dep[0] for dep
- in taskdata.itervalues()
+ in list(taskdata.values())
if not dep[0].endswith("-native")]))
extra_depends = d.getVar("EXTRA_IMAGEDEPENDS", True)
boot_depends = get_boot_dependencies(d)
@@ -261,7 +261,7 @@ def get_boot_dependencies(d):
depends.append(dep)
# We need to search for the provider of the dependency
else:
- for taskdep in taskdepdata.itervalues():
+ for taskdep in taskdepdata.values():
# The fifth field contains what the task provides
if dep in taskdep[4]:
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):
sdk_install_targets = d.getVar('SDK_TARGETS', True)
depd = d.getVar('BB_TASKDEPDATA', False)
- for v in depd.itervalues():
+ for v in depd.values():
if v[1] == 'do_image_complete':
if v[0] not in sdk_install_targets:
sdk_install_targets += ' {}'.format(v[0])
@@ -267,7 +267,7 @@ python copy_buildsystem () {
# Ensure any variables set from the external environment (by way of
# BB_ENV_EXTRAWHITE) are set in the SDK's configuration
extralines = []
- for name, value in env_whitelist_values.iteritems():
+ for name, value in env_whitelist_values.items():
actualvalue = d.getVar(name, True) or ''
if value != actualvalue:
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:
def pkglist_combine(depver):
pkglist = []
- for k,v in depver.iteritems():
+ for k,v in depver.items():
if v:
pkglist.append("%s (%s)" % (k,v))
else:
@@ -220,7 +220,7 @@ def compare_file_lists(alines, blines):
adict = file_list_to_dict(alines)
bdict = file_list_to_dict(blines)
filechanges = []
- for path, splitv in adict.iteritems():
+ for path, splitv in adict.items():
newsplitv = bdict.pop(path, None)
if newsplitv:
# 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):
def generate_locked_sigs(sigfile, d):
bb.utils.mkdirhier(os.path.dirname(sigfile))
depd = d.getVar('BB_TASKDEPDATA', False)
- tasks = ['%s.%s' % (v[2], v[1]) for v in depd.itervalues()]
+ tasks = ['%s.%s' % (v[2], v[1]) for v in depd.values()]
bb.parse.siggen.dump_lockedsigs(sigfile, tasks)
def 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):
flags = d.getVarFlags(key)
if flags is not None:
flags = dict((flag, d.expand(value))
- for flag, value in flags.iteritems())
+ for flag, value in list(flags.items()))
else:
flags = {}
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=''):
varfiles = get_var_files(fn, varlist, d)
locs = localise_file_vars(fn, varfiles, varlist)
patches = []
- for f,v in locs.iteritems():
+ for f,v in locs.items():
vals = {k: varvalues[k] for k in v}
patchdata = patch_recipe_file(f, vals, patch, relpath)
if patch:
@@ -554,7 +554,7 @@ def bbappend_recipe(rd, destlayerdir, srcfiles, install=None, wildcardver=False,
bbappendlines = []
if extralines:
if isinstance(extralines, dict):
- for name, value in extralines.iteritems():
+ for name, value in extralines.items():
bbappendlines.append((name, '=', value))
else:
# Do our best to split it
@@ -594,7 +594,7 @@ def bbappend_recipe(rd, destlayerdir, srcfiles, install=None, wildcardver=False,
copyfiles = {}
if srcfiles:
instfunclines = []
- for newfile, origsrcfile in srcfiles.iteritems():
+ for newfile, origsrcfile in srcfiles.items():
srcfile = origsrcfile
srcurientry = None
if not srcfile:
@@ -717,7 +717,7 @@ def bbappend_recipe(rd, destlayerdir, srcfiles, install=None, wildcardver=False,
if copyfiles:
if machine:
destsubdir = os.path.join(destsubdir, machine)
- for newfile, srcfile in copyfiles.iteritems():
+ for newfile, srcfile in copyfiles.items():
filedest = os.path.join(appenddir, destsubdir, os.path.basename(srcfile))
if os.path.abspath(newfile) != os.path.abspath(filedest):
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):
for task in range(len(sq_fn)):
if task not in ret:
for pn in self.lockedsigs:
- if sq_hash[task] in self.lockedsigs[pn].itervalues():
+ if sq_hash[task] in iter(self.lockedsigs[pn].values()):
if sq_task[task] == 'do_shared_workdir':
continue
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):
missingvars = {}
- for var, value in checkvars.iteritems():
+ for var, value in checkvars.items():
if value is not None:
missingvars[var] = value
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/"
files1 = get_files(topdir + "/tmp-sstatesamehash/stamps/")
files2 = get_files(topdir + "/tmp-sstatesamehash2/stamps/")
# Remove items that are identical in both sets
- for k,v in files1.viewitems() & files2.viewitems():
+ for k,v in files1.items() & files2.items():
del files1[k]
del files2[k]
if not files1 and not files2:
# No changes, so we're done
return
- for k in files1.viewkeys() | files2.viewkeys():
+ for k in files1.keys() | files2.keys():
if k in files1 and k in files2:
print("%s differs:" % k)
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):
def wrap_ob(ob):
for name in args:
setattr(ob, __tag_prefix + name, True)
- for name, value in kwargs.iteritems():
+ for name, value in kwargs.items():
setattr(ob, __tag_prefix + name, value)
return ob
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):
linecount = 0
with open(fileitem, 'r') as f:
for line in f:
- for value, varname in valuemap.iteritems():
+ for value, varname in valuemap.items():
if line.startswith(value + ':') and not varname in foundvalues:
foundvalues[varname] = line.split(':', 1)[1].strip()
break