summaryrefslogtreecommitdiffstats
path: root/meta/lib
diff options
context:
space:
mode:
authorRichard Purdie <richard.purdie@linuxfoundation.org>2016-05-20 11:53:11 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2016-06-02 08:24:00 +0100
commit44e9a0d2fa759dea281fc32b602cd7878000c277 (patch)
tree69f6944e4bf34e2309ae8b3cc11eac13afcdf675 /meta/lib
parent8587bce564f715e46e7317218b5c190813d3a939 (diff)
downloadpoky-44e9a0d2fa759dea281fc32b602cd7878000c277.tar.gz
classes/lib: Update to explictly create lists where needed
Iterators now return views, not lists in python3. Where we need lists, handle this explicitly. (From OE-Core rev: caebd862bac7eed725e0f0321bf50793671b5312) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/lib')
-rw-r--r--meta/lib/oe/classutils.py2
-rw-r--r--meta/lib/oe/copy_buildsystem.py2
-rw-r--r--meta/lib/oe/distro_check.py4
-rw-r--r--meta/lib/oe/license.py10
-rw-r--r--meta/lib/oe/manifest.py4
-rw-r--r--meta/lib/oe/package_manager.py6
-rw-r--r--meta/lib/oe/packagedata.py2
-rw-r--r--meta/lib/oe/packagegroup.py4
-rw-r--r--meta/lib/oe/prservice.py4
-rw-r--r--meta/lib/oe/recipeutils.py6
-rw-r--r--meta/lib/oe/rootfs.py4
-rw-r--r--meta/lib/oe/sstatesig.py2
-rw-r--r--meta/lib/oe/utils.py6
-rw-r--r--meta/lib/oeqa/selftest/pkgdata.py56
-rw-r--r--meta/lib/oeqa/utils/qemurunner.py2
15 files changed, 57 insertions, 57 deletions
diff --git a/meta/lib/oe/classutils.py b/meta/lib/oe/classutils.py
index 58188fdd6e..98bb059a71 100644
--- a/meta/lib/oe/classutils.py
+++ b/meta/lib/oe/classutils.py
@@ -34,7 +34,7 @@ abstract base classes out of the registry)."""
34 34
35 @classmethod 35 @classmethod
36 def prioritized(tcls): 36 def prioritized(tcls):
37 return sorted(tcls.registry.values(), 37 return sorted(list(tcls.registry.values()),
38 key=lambda v: v.priority, reverse=True) 38 key=lambda v: v.priority, reverse=True)
39 39
40 def unregister(cls): 40 def unregister(cls):
diff --git a/meta/lib/oe/copy_buildsystem.py b/meta/lib/oe/copy_buildsystem.py
index 0589b7f045..eddf5bb2da 100644
--- a/meta/lib/oe/copy_buildsystem.py
+++ b/meta/lib/oe/copy_buildsystem.py
@@ -195,7 +195,7 @@ def merge_lockedsigs(copy_tasks, lockedsigs_main, lockedsigs_extra, merged_outpu
195 fulltypes.append(typename) 195 fulltypes.append(typename)
196 f.write('SIGGEN_LOCKEDSIGS_TYPES = "%s"\n' % ' '.join(fulltypes)) 196 f.write('SIGGEN_LOCKEDSIGS_TYPES = "%s"\n' % ' '.join(fulltypes))
197 197
198 write_sigs_file(copy_output, tocopy.keys(), tocopy) 198 write_sigs_file(copy_output, list(tocopy.keys()), tocopy)
199 if merged_output: 199 if merged_output:
200 write_sigs_file(merged_output, arch_order, merged) 200 write_sigs_file(merged_output, arch_order, merged)
201 201
diff --git a/meta/lib/oe/distro_check.py b/meta/lib/oe/distro_check.py
index 8655a6fc14..ba1bba678d 100644
--- a/meta/lib/oe/distro_check.py
+++ b/meta/lib/oe/distro_check.py
@@ -104,8 +104,8 @@ def get_source_package_list_from_url(url, section, d):
104 104
105 bb.note("Reading %s: %s" % (url, section)) 105 bb.note("Reading %s: %s" % (url, section))
106 links = get_links_from_url(url, d) 106 links = get_links_from_url(url, d)
107 srpms = filter(is_src_rpm, links) 107 srpms = list(filter(is_src_rpm, links))
108 names_list = map(package_name_from_srpm, srpms) 108 names_list = list(map(package_name_from_srpm, srpms))
109 109
110 new_pkgs = [] 110 new_pkgs = []
111 for pkgs in names_list: 111 for pkgs in names_list:
diff --git a/meta/lib/oe/license.py b/meta/lib/oe/license.py
index f0f661c3ba..39ef9654fc 100644
--- a/meta/lib/oe/license.py
+++ b/meta/lib/oe/license.py
@@ -47,7 +47,7 @@ class LicenseVisitor(ast.NodeVisitor):
47 """Get elements based on OpenEmbedded license strings""" 47 """Get elements based on OpenEmbedded license strings"""
48 def get_elements(self, licensestr): 48 def get_elements(self, licensestr):
49 new_elements = [] 49 new_elements = []
50 elements = filter(lambda x: x.strip(), license_operator.split(licensestr)) 50 elements = list([x for x in license_operator.split(licensestr) if x.strip()])
51 for pos, element in enumerate(elements): 51 for pos, element in enumerate(elements):
52 if license_pattern.match(element): 52 if license_pattern.match(element):
53 if pos > 0 and license_pattern.match(elements[pos-1]): 53 if pos > 0 and license_pattern.match(elements[pos-1]):
@@ -118,8 +118,8 @@ def is_included(licensestr, whitelist=None, blacklist=None):
118 def choose_licenses(alpha, beta): 118 def choose_licenses(alpha, beta):
119 """Select the option in an OR which is the 'best' (has the most 119 """Select the option in an OR which is the 'best' (has the most
120 included licenses).""" 120 included licenses)."""
121 alpha_weight = len(filter(include_license, alpha)) 121 alpha_weight = len(list(filter(include_license, alpha)))
122 beta_weight = len(filter(include_license, beta)) 122 beta_weight = len(list(filter(include_license, beta)))
123 if alpha_weight > beta_weight: 123 if alpha_weight > beta_weight:
124 return alpha 124 return alpha
125 else: 125 else:
@@ -132,8 +132,8 @@ def is_included(licensestr, whitelist=None, blacklist=None):
132 blacklist = [] 132 blacklist = []
133 133
134 licenses = flattened_licenses(licensestr, choose_licenses) 134 licenses = flattened_licenses(licensestr, choose_licenses)
135 excluded = filter(lambda lic: exclude_license(lic), licenses) 135 excluded = [lic for lic in licenses if exclude_license(lic)]
136 included = filter(lambda lic: include_license(lic), licenses) 136 included = [lic for lic in licenses if include_license(lic)]
137 if excluded: 137 if excluded:
138 return False, excluded 138 return False, excluded
139 else: 139 else:
diff --git a/meta/lib/oe/manifest.py b/meta/lib/oe/manifest.py
index 42832f15d2..ec2ef500b2 100644
--- a/meta/lib/oe/manifest.py
+++ b/meta/lib/oe/manifest.py
@@ -219,7 +219,7 @@ class RpmManifest(Manifest):
219 if var in self.vars_to_split: 219 if var in self.vars_to_split:
220 split_pkgs = self._split_multilib(self.d.getVar(var, True)) 220 split_pkgs = self._split_multilib(self.d.getVar(var, True))
221 if split_pkgs is not None: 221 if split_pkgs is not None:
222 pkgs = dict(pkgs.items() + split_pkgs.items()) 222 pkgs = dict(list(pkgs.items()) + list(split_pkgs.items()))
223 else: 223 else:
224 pkg_list = self.d.getVar(var, True) 224 pkg_list = self.d.getVar(var, True)
225 if pkg_list is not None: 225 if pkg_list is not None:
@@ -269,7 +269,7 @@ class OpkgManifest(Manifest):
269 if var in self.vars_to_split: 269 if var in self.vars_to_split:
270 split_pkgs = self._split_multilib(self.d.getVar(var, True)) 270 split_pkgs = self._split_multilib(self.d.getVar(var, True))
271 if split_pkgs is not None: 271 if split_pkgs is not None:
272 pkgs = dict(pkgs.items() + split_pkgs.items()) 272 pkgs = dict(list(pkgs.items()) + list(split_pkgs.items()))
273 else: 273 else:
274 pkg_list = self.d.getVar(var, True) 274 pkg_list = self.d.getVar(var, True)
275 if pkg_list is not None: 275 if pkg_list is not None:
diff --git a/meta/lib/oe/package_manager.py b/meta/lib/oe/package_manager.py
index abe9f6878b..54e6970298 100644
--- a/meta/lib/oe/package_manager.py
+++ b/meta/lib/oe/package_manager.py
@@ -643,8 +643,8 @@ class PackageManager(object):
643 def construct_uris(self, uris, base_paths): 643 def construct_uris(self, uris, base_paths):
644 def _append(arr1, arr2, sep='/'): 644 def _append(arr1, arr2, sep='/'):
645 res = [] 645 res = []
646 narr1 = map(lambda a: string.rstrip(a, sep), arr1) 646 narr1 = [string.rstrip(a, sep) for a in arr1]
647 narr2 = map(lambda a: string.lstrip(string.rstrip(a, sep), sep), arr2) 647 narr2 = [string.lstrip(string.rstrip(a, sep), sep) for a in arr2]
648 for a1 in narr1: 648 for a1 in narr1:
649 if arr2: 649 if arr2:
650 for a2 in narr2: 650 for a2 in narr2:
@@ -1111,7 +1111,7 @@ class RpmPM(PackageManager):
1111 sub_rdep = sub_data.get("RDEPENDS_" + pkg) 1111 sub_rdep = sub_data.get("RDEPENDS_" + pkg)
1112 if not sub_rdep: 1112 if not sub_rdep:
1113 continue 1113 continue
1114 done = bb.utils.explode_dep_versions2(sub_rdep).keys() 1114 done = list(bb.utils.explode_dep_versions2(sub_rdep).keys())
1115 next = done 1115 next = done
1116 # Find all the rdepends on dependency chain 1116 # Find all the rdepends on dependency chain
1117 while next: 1117 while next:
diff --git a/meta/lib/oe/packagedata.py b/meta/lib/oe/packagedata.py
index df1b4c52e3..21d4de914f 100644
--- a/meta/lib/oe/packagedata.py
+++ b/meta/lib/oe/packagedata.py
@@ -66,7 +66,7 @@ def _pkgmap(d):
66 bb.warn("No files in %s?" % pkgdatadir) 66 bb.warn("No files in %s?" % pkgdatadir)
67 files = [] 67 files = []
68 68
69 for pn in filter(lambda f: not os.path.isdir(os.path.join(pkgdatadir, f)), files): 69 for pn in [f for f in files if not os.path.isdir(os.path.join(pkgdatadir, f))]:
70 try: 70 try:
71 pkgdata = read_pkgdatafile(os.path.join(pkgdatadir, pn)) 71 pkgdata = read_pkgdatafile(os.path.join(pkgdatadir, pn))
72 except OSError: 72 except OSError:
diff --git a/meta/lib/oe/packagegroup.py b/meta/lib/oe/packagegroup.py
index a6fee5f950..97819279b7 100644
--- a/meta/lib/oe/packagegroup.py
+++ b/meta/lib/oe/packagegroup.py
@@ -16,11 +16,11 @@ def packages(features, d):
16 yield pkg 16 yield pkg
17 17
18def required_packages(features, d): 18def required_packages(features, d):
19 req = filter(lambda feature: not is_optional(feature, d), features) 19 req = [feature for feature in features if not is_optional(feature, d)]
20 return packages(req, d) 20 return packages(req, d)
21 21
22def optional_packages(features, d): 22def optional_packages(features, d):
23 opt = filter(lambda feature: is_optional(feature, d), features) 23 opt = [feature for feature in features if is_optional(feature, d)]
24 return packages(opt, d) 24 return packages(opt, d)
25 25
26def active_packages(features, d): 26def active_packages(features, d):
diff --git a/meta/lib/oe/prservice.py b/meta/lib/oe/prservice.py
index 9e5a0c9830..0054f954cc 100644
--- a/meta/lib/oe/prservice.py
+++ b/meta/lib/oe/prservice.py
@@ -1,7 +1,7 @@
1 1
2def prserv_make_conn(d, check = False): 2def prserv_make_conn(d, check = False):
3 import prserv.serv 3 import prserv.serv
4 host_params = filter(None, (d.getVar("PRSERV_HOST", True) or '').split(':')) 4 host_params = list([_f for _f in (d.getVar("PRSERV_HOST", True) or '').split(':') if _f])
5 try: 5 try:
6 conn = None 6 conn = None
7 conn = prserv.serv.PRServerConnection(host_params[0], int(host_params[1])) 7 conn = prserv.serv.PRServerConnection(host_params[0], int(host_params[1]))
@@ -114,7 +114,7 @@ def prserv_export_tofile(d, metainfo, datainfo, lockdown, nomax=False):
114 bb.utils.unlockfile(lf) 114 bb.utils.unlockfile(lf)
115 115
116def prserv_check_avail(d): 116def prserv_check_avail(d):
117 host_params = filter(None, (d.getVar("PRSERV_HOST", True) or '').split(':')) 117 host_params = list([_f for _f in (d.getVar("PRSERV_HOST", True) or '').split(':') if _f])
118 try: 118 try:
119 if len(host_params) != 2: 119 if len(host_params) != 2:
120 raise TypeError 120 raise TypeError
diff --git a/meta/lib/oe/recipeutils.py b/meta/lib/oe/recipeutils.py
index b437720fe7..146fe83e18 100644
--- a/meta/lib/oe/recipeutils.py
+++ b/meta/lib/oe/recipeutils.py
@@ -692,7 +692,7 @@ def bbappend_recipe(rd, destlayerdir, srcfiles, install=None, wildcardver=False,
692 692
693 varnames = [item[0] for item in bbappendlines] 693 varnames = [item[0] for item in bbappendlines]
694 if removevalues: 694 if removevalues:
695 varnames.extend(removevalues.keys()) 695 varnames.extend(list(removevalues.keys()))
696 696
697 with open(appendpath, 'r') as f: 697 with open(appendpath, 'r') as f:
698 (updated, newlines) = bb.utils.edit_metadata(f, varnames, appendfile_varfunc) 698 (updated, newlines) = bb.utils.edit_metadata(f, varnames, appendfile_varfunc)
@@ -743,12 +743,12 @@ def replace_dir_vars(path, d):
743 """Replace common directory paths with appropriate variable references (e.g. /etc becomes ${sysconfdir})""" 743 """Replace common directory paths with appropriate variable references (e.g. /etc becomes ${sysconfdir})"""
744 dirvars = {} 744 dirvars = {}
745 # Sort by length so we get the variables we're interested in first 745 # Sort by length so we get the variables we're interested in first
746 for var in sorted(d.keys(), key=len): 746 for var in sorted(list(d.keys()), key=len):
747 if var.endswith('dir') and var.lower() == var: 747 if var.endswith('dir') and var.lower() == var:
748 value = d.getVar(var, True) 748 value = d.getVar(var, True)
749 if value.startswith('/') and not '\n' in value and value not in dirvars: 749 if value.startswith('/') and not '\n' in value and value not in dirvars:
750 dirvars[value] = var 750 dirvars[value] = var
751 for dirpath in sorted(dirvars.keys(), reverse=True): 751 for dirpath in sorted(list(dirvars.keys()), reverse=True):
752 path = path.replace(dirpath, '${%s}' % dirvars[dirpath]) 752 path = path.replace(dirpath, '${%s}' % dirvars[dirpath])
753 return path 753 return path
754 754
diff --git a/meta/lib/oe/rootfs.py b/meta/lib/oe/rootfs.py
index 7087b12f25..d93485819a 100644
--- a/meta/lib/oe/rootfs.py
+++ b/meta/lib/oe/rootfs.py
@@ -536,7 +536,7 @@ class DpkgOpkgRootfs(Rootfs):
536 pkg_depends = m_depends.group(1) 536 pkg_depends = m_depends.group(1)
537 537
538 # remove package dependencies not in postinsts 538 # remove package dependencies not in postinsts
539 pkg_names = pkgs.keys() 539 pkg_names = list(pkgs.keys())
540 for pkg_name in pkg_names: 540 for pkg_name in pkg_names:
541 deps = pkgs[pkg_name][:] 541 deps = pkgs[pkg_name][:]
542 542
@@ -569,7 +569,7 @@ class DpkgOpkgRootfs(Rootfs):
569 pkgs = self._get_pkgs_postinsts(status_file) 569 pkgs = self._get_pkgs_postinsts(status_file)
570 if pkgs: 570 if pkgs:
571 root = "__packagegroup_postinst__" 571 root = "__packagegroup_postinst__"
572 pkgs[root] = pkgs.keys() 572 pkgs[root] = list(pkgs.keys())
573 _dep_resolve(pkgs, root, pkg_list, []) 573 _dep_resolve(pkgs, root, pkg_list, [])
574 pkg_list.remove(root) 574 pkg_list.remove(root)
575 575
diff --git a/meta/lib/oe/sstatesig.py b/meta/lib/oe/sstatesig.py
index 500122d461..a58f03a342 100644
--- a/meta/lib/oe/sstatesig.py
+++ b/meta/lib/oe/sstatesig.py
@@ -210,7 +210,7 @@ class SignatureGeneratorOEBasicHash(bb.siggen.SignatureGeneratorBasicHash):
210 continue 210 continue
211 f.write(" " + self.lockedpnmap[fn] + ":" + task + ":" + self.taskhash[k] + " \\\n") 211 f.write(" " + self.lockedpnmap[fn] + ":" + task + ":" + self.taskhash[k] + " \\\n")
212 f.write(' "\n') 212 f.write(' "\n')
213 f.write('SIGGEN_LOCKEDSIGS_TYPES_%s = "%s"' % (self.machine, " ".join(types.keys()))) 213 f.write('SIGGEN_LOCKEDSIGS_TYPES_%s = "%s"' % (self.machine, " ".join(list(types.keys()))))
214 214
215 def checkhashes(self, missed, ret, sq_fn, sq_task, sq_hash, sq_hashfn, d): 215 def checkhashes(self, missed, ret, sq_fn, sq_task, sq_hash, sq_hashfn, d):
216 warn_msgs = [] 216 warn_msgs = []
diff --git a/meta/lib/oe/utils.py b/meta/lib/oe/utils.py
index 32d61794ee..1bbdbb4bd5 100644
--- a/meta/lib/oe/utils.py
+++ b/meta/lib/oe/utils.py
@@ -85,11 +85,11 @@ def prune_suffix(var, suffixes, d):
85 85
86def str_filter(f, str, d): 86def str_filter(f, str, d):
87 from re import match 87 from re import match
88 return " ".join(filter(lambda x: match(f, x, 0), str.split())) 88 return " ".join([x for x in str.split() if match(f, x, 0)])
89 89
90def str_filter_out(f, str, d): 90def str_filter_out(f, str, d):
91 from re import match 91 from re import match
92 return " ".join(filter(lambda x: not match(f, x, 0), str.split())) 92 return " ".join([x for x in str.split() if not match(f, x, 0)])
93 93
94def param_bool(cfg, field, dflt = None): 94def param_bool(cfg, field, dflt = None):
95 """Lookup <field> in <cfg> map and convert it to a boolean; take 95 """Lookup <field> in <cfg> map and convert it to a boolean; take
@@ -134,7 +134,7 @@ def packages_filter_out_system(d):
134 PN-dbg PN-doc PN-locale-eb-gb removed. 134 PN-dbg PN-doc PN-locale-eb-gb removed.
135 """ 135 """
136 pn = d.getVar('PN', True) 136 pn = d.getVar('PN', True)
137 blacklist = map(lambda suffix: pn + suffix, ('', '-dbg', '-dev', '-doc', '-locale', '-staticdev')) 137 blacklist = [pn + suffix for suffix in ('', '-dbg', '-dev', '-doc', '-locale', '-staticdev')]
138 localepkg = pn + "-locale-" 138 localepkg = pn + "-locale-"
139 pkgs = [] 139 pkgs = []
140 140
diff --git a/meta/lib/oeqa/selftest/pkgdata.py b/meta/lib/oeqa/selftest/pkgdata.py
index 138b03aadb..5a63f89ff2 100644
--- a/meta/lib/oeqa/selftest/pkgdata.py
+++ b/meta/lib/oeqa/selftest/pkgdata.py
@@ -131,15 +131,15 @@ class OePkgdataUtilTests(oeSelfTest):
131 # Test recipe-space package name 131 # Test recipe-space package name
132 result = runCmd('oe-pkgdata-util list-pkg-files zlib-dev zlib-doc') 132 result = runCmd('oe-pkgdata-util list-pkg-files zlib-dev zlib-doc')
133 files = splitoutput(result.output) 133 files = splitoutput(result.output)
134 self.assertIn('zlib-dev', files.keys(), "listed pkgs. files: %s" %result.output) 134 self.assertIn('zlib-dev', list(files.keys()), "listed pkgs. files: %s" %result.output)
135 self.assertIn('zlib-doc', files.keys(), "listed pkgs. files: %s" %result.output) 135 self.assertIn('zlib-doc', list(files.keys()), "listed pkgs. files: %s" %result.output)
136 self.assertIn(os.path.join(includedir, 'zlib.h'), files['zlib-dev']) 136 self.assertIn(os.path.join(includedir, 'zlib.h'), files['zlib-dev'])
137 self.assertIn(os.path.join(mandir, 'man3/zlib.3'), files['zlib-doc']) 137 self.assertIn(os.path.join(mandir, 'man3/zlib.3'), files['zlib-doc'])
138 # Test runtime package name 138 # Test runtime package name
139 result = runCmd('oe-pkgdata-util list-pkg-files -r libz1 libz-dev') 139 result = runCmd('oe-pkgdata-util list-pkg-files -r libz1 libz-dev')
140 files = splitoutput(result.output) 140 files = splitoutput(result.output)
141 self.assertIn('libz1', files.keys(), "listed pkgs. files: %s" %result.output) 141 self.assertIn('libz1', list(files.keys()), "listed pkgs. files: %s" %result.output)
142 self.assertIn('libz-dev', files.keys(), "listed pkgs. files: %s" %result.output) 142 self.assertIn('libz-dev', list(files.keys()), "listed pkgs. files: %s" %result.output)
143 self.assertGreater(len(files['libz1']), 1) 143 self.assertGreater(len(files['libz1']), 1)
144 libspec = os.path.join(base_libdir, 'libz.so.1.*') 144 libspec = os.path.join(base_libdir, 'libz.so.1.*')
145 found = False 145 found = False
@@ -152,12 +152,12 @@ class OePkgdataUtilTests(oeSelfTest):
152 # Test recipe 152 # Test recipe
153 result = runCmd('oe-pkgdata-util list-pkg-files -p zlib') 153 result = runCmd('oe-pkgdata-util list-pkg-files -p zlib')
154 files = splitoutput(result.output) 154 files = splitoutput(result.output)
155 self.assertIn('zlib-dbg', files.keys(), "listed pkgs. files: %s" %result.output) 155 self.assertIn('zlib-dbg', list(files.keys()), "listed pkgs. files: %s" %result.output)
156 self.assertIn('zlib-doc', files.keys(), "listed pkgs. files: %s" %result.output) 156 self.assertIn('zlib-doc', list(files.keys()), "listed pkgs. files: %s" %result.output)
157 self.assertIn('zlib-dev', files.keys(), "listed pkgs. files: %s" %result.output) 157 self.assertIn('zlib-dev', list(files.keys()), "listed pkgs. files: %s" %result.output)
158 self.assertIn('zlib-staticdev', files.keys(), "listed pkgs. files: %s" %result.output) 158 self.assertIn('zlib-staticdev', list(files.keys()), "listed pkgs. files: %s" %result.output)
159 self.assertIn('zlib', files.keys(), "listed pkgs. files: %s" %result.output) 159 self.assertIn('zlib', list(files.keys()), "listed pkgs. files: %s" %result.output)
160 self.assertNotIn('zlib-locale', files.keys(), "listed pkgs. files: %s" %result.output) 160 self.assertNotIn('zlib-locale', list(files.keys()), "listed pkgs. files: %s" %result.output)
161 # (ignore ptest, might not be there depending on config) 161 # (ignore ptest, might not be there depending on config)
162 self.assertIn(os.path.join(includedir, 'zlib.h'), files['zlib-dev']) 162 self.assertIn(os.path.join(includedir, 'zlib.h'), files['zlib-dev'])
163 self.assertIn(os.path.join(mandir, 'man3/zlib.3'), files['zlib-doc']) 163 self.assertIn(os.path.join(mandir, 'man3/zlib.3'), files['zlib-doc'])
@@ -165,36 +165,36 @@ class OePkgdataUtilTests(oeSelfTest):
165 # Test recipe, runtime 165 # Test recipe, runtime
166 result = runCmd('oe-pkgdata-util list-pkg-files -p zlib -r') 166 result = runCmd('oe-pkgdata-util list-pkg-files -p zlib -r')
167 files = splitoutput(result.output) 167 files = splitoutput(result.output)
168 self.assertIn('libz-dbg', files.keys(), "listed pkgs. files: %s" %result.output) 168 self.assertIn('libz-dbg', list(files.keys()), "listed pkgs. files: %s" %result.output)
169 self.assertIn('libz-doc', files.keys(), "listed pkgs. files: %s" %result.output) 169 self.assertIn('libz-doc', list(files.keys()), "listed pkgs. files: %s" %result.output)
170 self.assertIn('libz-dev', files.keys(), "listed pkgs. files: %s" %result.output) 170 self.assertIn('libz-dev', list(files.keys()), "listed pkgs. files: %s" %result.output)
171 self.assertIn('libz-staticdev', files.keys(), "listed pkgs. files: %s" %result.output) 171 self.assertIn('libz-staticdev', list(files.keys()), "listed pkgs. files: %s" %result.output)
172 self.assertIn('libz1', files.keys(), "listed pkgs. files: %s" %result.output) 172 self.assertIn('libz1', list(files.keys()), "listed pkgs. files: %s" %result.output)
173 self.assertNotIn('libz-locale', files.keys(), "listed pkgs. files: %s" %result.output) 173 self.assertNotIn('libz-locale', list(files.keys()), "listed pkgs. files: %s" %result.output)
174 self.assertIn(os.path.join(includedir, 'zlib.h'), files['libz-dev']) 174 self.assertIn(os.path.join(includedir, 'zlib.h'), files['libz-dev'])
175 self.assertIn(os.path.join(mandir, 'man3/zlib.3'), files['libz-doc']) 175 self.assertIn(os.path.join(mandir, 'man3/zlib.3'), files['libz-doc'])
176 self.assertIn(os.path.join(libdir, 'libz.a'), files['libz-staticdev']) 176 self.assertIn(os.path.join(libdir, 'libz.a'), files['libz-staticdev'])
177 # Test recipe, unpackaged 177 # Test recipe, unpackaged
178 result = runCmd('oe-pkgdata-util list-pkg-files -p zlib -u') 178 result = runCmd('oe-pkgdata-util list-pkg-files -p zlib -u')
179 files = splitoutput(result.output) 179 files = splitoutput(result.output)
180 self.assertIn('zlib-dbg', files.keys(), "listed pkgs. files: %s" %result.output) 180 self.assertIn('zlib-dbg', list(files.keys()), "listed pkgs. files: %s" %result.output)
181 self.assertIn('zlib-doc', files.keys(), "listed pkgs. files: %s" %result.output) 181 self.assertIn('zlib-doc', list(files.keys()), "listed pkgs. files: %s" %result.output)
182 self.assertIn('zlib-dev', files.keys(), "listed pkgs. files: %s" %result.output) 182 self.assertIn('zlib-dev', list(files.keys()), "listed pkgs. files: %s" %result.output)
183 self.assertIn('zlib-staticdev', files.keys(), "listed pkgs. files: %s" %result.output) 183 self.assertIn('zlib-staticdev', list(files.keys()), "listed pkgs. files: %s" %result.output)
184 self.assertIn('zlib', files.keys(), "listed pkgs. files: %s" %result.output) 184 self.assertIn('zlib', list(files.keys()), "listed pkgs. files: %s" %result.output)
185 self.assertIn('zlib-locale', files.keys(), "listed pkgs. files: %s" %result.output) # this is the key one 185 self.assertIn('zlib-locale', list(files.keys()), "listed pkgs. files: %s" %result.output) # this is the key one
186 self.assertIn(os.path.join(includedir, 'zlib.h'), files['zlib-dev']) 186 self.assertIn(os.path.join(includedir, 'zlib.h'), files['zlib-dev'])
187 self.assertIn(os.path.join(mandir, 'man3/zlib.3'), files['zlib-doc']) 187 self.assertIn(os.path.join(mandir, 'man3/zlib.3'), files['zlib-doc'])
188 self.assertIn(os.path.join(libdir, 'libz.a'), files['zlib-staticdev']) 188 self.assertIn(os.path.join(libdir, 'libz.a'), files['zlib-staticdev'])
189 # Test recipe, runtime, unpackaged 189 # Test recipe, runtime, unpackaged
190 result = runCmd('oe-pkgdata-util list-pkg-files -p zlib -r -u') 190 result = runCmd('oe-pkgdata-util list-pkg-files -p zlib -r -u')
191 files = splitoutput(result.output) 191 files = splitoutput(result.output)
192 self.assertIn('libz-dbg', files.keys(), "listed pkgs. files: %s" %result.output) 192 self.assertIn('libz-dbg', list(files.keys()), "listed pkgs. files: %s" %result.output)
193 self.assertIn('libz-doc', files.keys(), "listed pkgs. files: %s" %result.output) 193 self.assertIn('libz-doc', list(files.keys()), "listed pkgs. files: %s" %result.output)
194 self.assertIn('libz-dev', files.keys(), "listed pkgs. files: %s" %result.output) 194 self.assertIn('libz-dev', list(files.keys()), "listed pkgs. files: %s" %result.output)
195 self.assertIn('libz-staticdev', files.keys(), "listed pkgs. files: %s" %result.output) 195 self.assertIn('libz-staticdev', list(files.keys()), "listed pkgs. files: %s" %result.output)
196 self.assertIn('libz1', files.keys(), "listed pkgs. files: %s" %result.output) 196 self.assertIn('libz1', list(files.keys()), "listed pkgs. files: %s" %result.output)
197 self.assertIn('libz-locale', files.keys(), "listed pkgs. files: %s" %result.output) # this is the key one 197 self.assertIn('libz-locale', list(files.keys()), "listed pkgs. files: %s" %result.output) # this is the key one
198 self.assertIn(os.path.join(includedir, 'zlib.h'), files['libz-dev']) 198 self.assertIn(os.path.join(includedir, 'zlib.h'), files['libz-dev'])
199 self.assertIn(os.path.join(mandir, 'man3/zlib.3'), files['libz-doc']) 199 self.assertIn(os.path.join(mandir, 'man3/zlib.3'), files['libz-doc'])
200 self.assertIn(os.path.join(libdir, 'libz.a'), files['libz-staticdev']) 200 self.assertIn(os.path.join(libdir, 'libz.a'), files['libz-staticdev'])
diff --git a/meta/lib/oeqa/utils/qemurunner.py b/meta/lib/oeqa/utils/qemurunner.py
index f51de99458..c1d07d9b41 100644
--- a/meta/lib/oeqa/utils/qemurunner.py
+++ b/meta/lib/oeqa/utils/qemurunner.py
@@ -22,7 +22,7 @@ import logging
22logger = logging.getLogger("BitBake.QemuRunner") 22logger = logging.getLogger("BitBake.QemuRunner")
23 23
24# Get Unicode non printable control chars 24# Get Unicode non printable control chars
25control_range = range(0,32)+range(127,160) 25control_range = list(range(0,32))+list(range(127,160))
26control_chars = [unichr(x) for x in control_range 26control_chars = [unichr(x) for x in control_range
27 if unichr(x) not in string.printable] 27 if unichr(x) not in string.printable]
28re_control_char = re.compile('[%s]' % re.escape("".join(control_chars))) 28re_control_char = re.compile('[%s]' % re.escape("".join(control_chars)))