summaryrefslogtreecommitdiffstats
path: root/meta/lib/oe
diff options
context:
space:
mode:
Diffstat (limited to 'meta/lib/oe')
-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
13 files changed, 28 insertions, 28 deletions
diff --git a/meta/lib/oe/classutils.py b/meta/lib/oe/classutils.py
index 58188fd..98bb059 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 0589b7f..eddf5bb 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 8655a6f..ba1bba6 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 f0f661c..39ef965 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 42832f1..ec2ef50 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 abe9f68..54e6970 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 df1b4c5..21d4de9 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 a6fee5f..9781927 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 9e5a0c9..0054f95 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 b437720..146fe83 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 7087b12..d934858 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 500122d..a58f03a 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 32d6179..1bbdbb4 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