diff options
author | Ed Bartosh <ed.bartosh@linux.intel.com> | 2016-05-18 21:39:44 +0300 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2016-06-02 08:24:01 +0100 |
commit | 7eab022d4b484aec40998f95835ba46c5da168cf (patch) | |
tree | e88a3bf01eada7d44e41bfadee5721ce6ec198e0 | |
parent | 63404baadbfd1225bbb955f8c8f817073aef65d8 (diff) | |
download | poky-7eab022d4b484aec40998f95835ba46c5da168cf.tar.gz |
scripts: Fix deprecated dict methods for python3
Replaced iteritems -> items, itervalues -> values,
iterkeys -> keys or 'in'
(From OE-Core rev: 25d4d8274bac696a484f83d7f3ada778cf95f4d0)
Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r-- | meta/lib/oe/recipeutils.py | 4 | ||||
-rwxr-xr-x | scripts/buildhistory-collect-srcrevs | 2 | ||||
-rwxr-xr-x | scripts/combo-layer | 2 | ||||
-rwxr-xr-x | scripts/contrib/bbvars.py | 10 | ||||
-rwxr-xr-x | scripts/contrib/list-packageconfig-flags.py | 4 | ||||
-rwxr-xr-x | scripts/contrib/python/generate-manifest-2.7.py | 4 | ||||
-rwxr-xr-x | scripts/contrib/python/generate-manifest-3.5.py | 4 | ||||
-rw-r--r-- | scripts/lib/devtool/__init__.py | 2 | ||||
-rw-r--r-- | scripts/lib/devtool/standard.py | 14 | ||||
-rw-r--r-- | scripts/lib/devtool/upgrade.py | 2 | ||||
-rw-r--r-- | scripts/lib/recipetool/append.py | 8 | ||||
-rw-r--r-- | scripts/lib/recipetool/create.py | 12 | ||||
-rw-r--r-- | scripts/lib/recipetool/create_buildsys.py | 10 | ||||
-rw-r--r-- | scripts/lib/recipetool/create_buildsys_python.py | 18 | ||||
-rw-r--r-- | scripts/lib/recipetool/create_npm.py | 4 | ||||
-rwxr-xr-x | scripts/pythondeps | 2 |
16 files changed, 51 insertions, 51 deletions
diff --git a/meta/lib/oe/recipeutils.py b/meta/lib/oe/recipeutils.py index 632184fcd9..1b8538785c 100644 --- a/meta/lib/oe/recipeutils.py +++ b/meta/lib/oe/recipeutils.py | |||
@@ -194,7 +194,7 @@ def patch_recipe_lines(fromlines, values, trailing_newline=True): | |||
194 | remainingnames = {} | 194 | remainingnames = {} |
195 | for k in values.keys(): | 195 | for k in values.keys(): |
196 | remainingnames[k] = get_recipe_pos(k) | 196 | remainingnames[k] = get_recipe_pos(k) |
197 | remainingnames = OrderedDict(sorted(remainingnames.iteritems(), key=lambda x: x[1])) | 197 | remainingnames = OrderedDict(sorted(remainingnames.items(), key=lambda x: x[1])) |
198 | 198 | ||
199 | modifying = False | 199 | modifying = False |
200 | 200 | ||
@@ -234,7 +234,7 @@ def patch_recipe_lines(fromlines, values, trailing_newline=True): | |||
234 | if modifying: | 234 | if modifying: |
235 | # Insert anything that should come before this variable | 235 | # Insert anything that should come before this variable |
236 | pos = get_recipe_pos(varname) | 236 | pos = get_recipe_pos(varname) |
237 | for k in remainingnames.keys()[:]: | 237 | for k in list(remainingnames): |
238 | if remainingnames[k] > -1 and pos >= remainingnames[k] and not k in existingnames: | 238 | if remainingnames[k] > -1 and pos >= remainingnames[k] and not k in existingnames: |
239 | outputvalue(k, newlines, rewindcomments=True) | 239 | outputvalue(k, newlines, rewindcomments=True) |
240 | del remainingnames[k] | 240 | del remainingnames[k] |
diff --git a/scripts/buildhistory-collect-srcrevs b/scripts/buildhistory-collect-srcrevs index f3eb76bd0d..79d2657ac8 100755 --- a/scripts/buildhistory-collect-srcrevs +++ b/scripts/buildhistory-collect-srcrevs | |||
@@ -103,7 +103,7 @@ def main(): | |||
103 | if options.reportall or value != orig: | 103 | if options.reportall or value != orig: |
104 | all_srcrevs[curdir].append((pn, name, srcrev)) | 104 | all_srcrevs[curdir].append((pn, name, srcrev)) |
105 | 105 | ||
106 | for curdir, srcrevs in sorted(all_srcrevs.iteritems()): | 106 | for curdir, srcrevs in sorted(all_srcrevs.items()): |
107 | if srcrevs: | 107 | if srcrevs: |
108 | print('# %s' % curdir) | 108 | print('# %s' % curdir) |
109 | for pn, name, srcrev in srcrevs: | 109 | for pn, name, srcrev in srcrevs: |
diff --git a/scripts/combo-layer b/scripts/combo-layer index e47059290d..52367f091d 100755 --- a/scripts/combo-layer +++ b/scripts/combo-layer | |||
@@ -1178,7 +1178,7 @@ def update_with_history(conf, components, revisions, repos): | |||
1178 | # components imported head revision. | 1178 | # components imported head revision. |
1179 | if additional_heads: | 1179 | if additional_heads: |
1180 | runcmd("git reset --hard", **wargs) | 1180 | runcmd("git reset --hard", **wargs) |
1181 | for rev, base in additional_heads.iteritems(): | 1181 | for rev, base in additional_heads.items(): |
1182 | apply_commit(base, rev, wargs, wargs, None) | 1182 | apply_commit(base, rev, wargs, wargs, None) |
1183 | 1183 | ||
1184 | # Commit with all component branches as parents as well as the previous head. | 1184 | # Commit with all component branches as parents as well as the previous head. |
diff --git a/scripts/contrib/bbvars.py b/scripts/contrib/bbvars.py index 04f5023969..6f479355eb 100755 --- a/scripts/contrib/bbvars.py +++ b/scripts/contrib/bbvars.py | |||
@@ -59,8 +59,8 @@ def collect_bbvars(metadir): | |||
59 | for root,dirs,files in os.walk(metadir): | 59 | for root,dirs,files in os.walk(metadir): |
60 | for name in files: | 60 | for name in files: |
61 | if name.find(".bb") >= 0: | 61 | if name.find(".bb") >= 0: |
62 | for key in recipe_bbvars(os.path.join(root,name)).iterkeys(): | 62 | for key in recipe_bbvars(os.path.join(root,name)).keys(): |
63 | if bbvars.has_key(key): | 63 | if key in bbvars: |
64 | bbvars[key] = bbvars[key] + 1 | 64 | bbvars[key] = bbvars[key] + 1 |
65 | else: | 65 | else: |
66 | bbvars[key] = 1 | 66 | bbvars[key] = 1 |
@@ -155,15 +155,15 @@ def main(): | |||
155 | 155 | ||
156 | # Collect all the variable names from the recipes in the metadirs | 156 | # Collect all the variable names from the recipes in the metadirs |
157 | for m in metadirs: | 157 | for m in metadirs: |
158 | for key,cnt in collect_bbvars(m).iteritems(): | 158 | for key,cnt in collect_bbvars(m).items(): |
159 | if bbvars.has_key(key): | 159 | if key in bbvars: |
160 | bbvars[key] = bbvars[key] + cnt | 160 | bbvars[key] = bbvars[key] + cnt |
161 | else: | 161 | else: |
162 | bbvars[key] = cnt | 162 | bbvars[key] = cnt |
163 | 163 | ||
164 | # Check each var for documentation | 164 | # Check each var for documentation |
165 | varlen = 0 | 165 | varlen = 0 |
166 | for v in bbvars.iterkeys(): | 166 | for v in bbvars.keys(): |
167 | if len(v) > varlen: | 167 | if len(v) > varlen: |
168 | varlen = len(v) | 168 | varlen = len(v) |
169 | if not bbvar_is_documented(v, docfiles): | 169 | if not bbvar_is_documented(v, docfiles): |
diff --git a/scripts/contrib/list-packageconfig-flags.py b/scripts/contrib/list-packageconfig-flags.py index 5dfe796c0a..22d0c4904d 100755 --- a/scripts/contrib/list-packageconfig-flags.py +++ b/scripts/contrib/list-packageconfig-flags.py | |||
@@ -86,7 +86,7 @@ def collect_flags(pkg_dict): | |||
86 | ''' Collect available PACKAGECONFIG flags and all affected pkgs ''' | 86 | ''' Collect available PACKAGECONFIG flags and all affected pkgs ''' |
87 | # flag_dict = {'flag': ['pkg1', 'pkg2',...]} | 87 | # flag_dict = {'flag': ['pkg1', 'pkg2',...]} |
88 | flag_dict = {} | 88 | flag_dict = {} |
89 | for pkgname, flaglist in pkg_dict.iteritems(): | 89 | for pkgname, flaglist in pkg_dict.items(): |
90 | for flag in flaglist: | 90 | for flag in flaglist: |
91 | if flag in flag_dict: | 91 | if flag in flag_dict: |
92 | flag_dict[flag].append(pkgname) | 92 | flag_dict[flag].append(pkgname) |
@@ -132,7 +132,7 @@ def display_all(data_dict): | |||
132 | packageconfig = 'None' | 132 | packageconfig = 'None' |
133 | print('PACKAGECONFIG %s' % packageconfig) | 133 | print('PACKAGECONFIG %s' % packageconfig) |
134 | 134 | ||
135 | for flag,flag_val in data_dict[fn].getVarFlags("PACKAGECONFIG").iteritems(): | 135 | for flag,flag_val in data_dict[fn].getVarFlags("PACKAGECONFIG").items(): |
136 | if flag == "doc": | 136 | if flag == "doc": |
137 | continue | 137 | continue |
138 | print('PACKAGECONFIG[%s] %s' % (flag, flag_val)) | 138 | print('PACKAGECONFIG[%s] %s' % (flag, flag_val)) |
diff --git a/scripts/contrib/python/generate-manifest-2.7.py b/scripts/contrib/python/generate-manifest-2.7.py index 48be3a6d74..f2ecf8d3f5 100755 --- a/scripts/contrib/python/generate-manifest-2.7.py +++ b/scripts/contrib/python/generate-manifest-2.7.py | |||
@@ -97,7 +97,7 @@ class MakefileMaker: | |||
97 | # generate package variables | 97 | # generate package variables |
98 | # | 98 | # |
99 | 99 | ||
100 | for name, data in sorted(self.packages.iteritems()): | 100 | for name, data in sorted(self.packages.items()): |
101 | desc, deps, files = data | 101 | desc, deps, files = data |
102 | 102 | ||
103 | # | 103 | # |
@@ -130,7 +130,7 @@ class MakefileMaker: | |||
130 | self.out( 'SUMMARY_${PN}-modules="All Python modules"' ) | 130 | self.out( 'SUMMARY_${PN}-modules="All Python modules"' ) |
131 | line = 'RDEPENDS_${PN}-modules="' | 131 | line = 'RDEPENDS_${PN}-modules="' |
132 | 132 | ||
133 | for name, data in sorted(self.packages.iteritems()): | 133 | for name, data in sorted(self.packages.items()): |
134 | if name not in ['${PN}-dev', '${PN}-distutils-staticdev']: | 134 | if name not in ['${PN}-dev', '${PN}-distutils-staticdev']: |
135 | line += "%s " % name | 135 | line += "%s " % name |
136 | 136 | ||
diff --git a/scripts/contrib/python/generate-manifest-3.5.py b/scripts/contrib/python/generate-manifest-3.5.py index a7b38d202a..41f209b17f 100755 --- a/scripts/contrib/python/generate-manifest-3.5.py +++ b/scripts/contrib/python/generate-manifest-3.5.py | |||
@@ -100,7 +100,7 @@ class MakefileMaker: | |||
100 | # generate package variables | 100 | # generate package variables |
101 | # | 101 | # |
102 | 102 | ||
103 | for name, data in sorted(self.packages.iteritems()): | 103 | for name, data in sorted(self.packages.items()): |
104 | desc, deps, files = data | 104 | desc, deps, files = data |
105 | 105 | ||
106 | # | 106 | # |
@@ -133,7 +133,7 @@ class MakefileMaker: | |||
133 | self.out( 'SUMMARY_${PN}-modules="All Python modules"' ) | 133 | self.out( 'SUMMARY_${PN}-modules="All Python modules"' ) |
134 | line = 'RDEPENDS_${PN}-modules="' | 134 | line = 'RDEPENDS_${PN}-modules="' |
135 | 135 | ||
136 | for name, data in sorted(self.packages.iteritems()): | 136 | for name, data in sorted(self.packages.items()): |
137 | if name not in ['${PN}-dev', '${PN}-distutils-staticdev']: | 137 | if name not in ['${PN}-dev', '${PN}-distutils-staticdev']: |
138 | line += "%s " % name | 138 | line += "%s " % name |
139 | 139 | ||
diff --git a/scripts/lib/devtool/__init__.py b/scripts/lib/devtool/__init__.py index ff97dfc94b..506d95b0f7 100644 --- a/scripts/lib/devtool/__init__.py +++ b/scripts/lib/devtool/__init__.py | |||
@@ -155,7 +155,7 @@ def check_workspace_recipe(workspace, pn, checksrc=True, bbclassextend=False): | |||
155 | 155 | ||
156 | workspacepn = pn | 156 | workspacepn = pn |
157 | 157 | ||
158 | for recipe, value in workspace.iteritems(): | 158 | for recipe, value in workspace.items(): |
159 | if recipe == pn: | 159 | if recipe == pn: |
160 | break | 160 | break |
161 | if bbclassextend: | 161 | if bbclassextend: |
diff --git a/scripts/lib/devtool/standard.py b/scripts/lib/devtool/standard.py index d6186b9ece..08153c6edc 100644 --- a/scripts/lib/devtool/standard.py +++ b/scripts/lib/devtool/standard.py | |||
@@ -1091,11 +1091,11 @@ def _update_recipe_srcrev(args, srctree, rd, config_data): | |||
1091 | else: | 1091 | else: |
1092 | files_dir = os.path.join(os.path.dirname(recipefile), | 1092 | files_dir = os.path.join(os.path.dirname(recipefile), |
1093 | rd.getVar('BPN', True)) | 1093 | rd.getVar('BPN', True)) |
1094 | for basepath, path in upd_f.iteritems(): | 1094 | for basepath, path in upd_f.items(): |
1095 | logger.info('Updating file %s' % basepath) | 1095 | logger.info('Updating file %s' % basepath) |
1096 | _move_file(os.path.join(local_files_dir, basepath), path) | 1096 | _move_file(os.path.join(local_files_dir, basepath), path) |
1097 | update_srcuri= True | 1097 | update_srcuri= True |
1098 | for basepath, path in new_f.iteritems(): | 1098 | for basepath, path in new_f.items(): |
1099 | logger.info('Adding new file %s' % basepath) | 1099 | logger.info('Adding new file %s' % basepath) |
1100 | _move_file(os.path.join(local_files_dir, basepath), | 1100 | _move_file(os.path.join(local_files_dir, basepath), |
1101 | os.path.join(files_dir, basepath)) | 1101 | os.path.join(files_dir, basepath)) |
@@ -1173,11 +1173,11 @@ def _update_recipe_patch(args, config, workspace, srctree, rd, config_data): | |||
1173 | logger.info('No patches or local source files needed updating') | 1173 | logger.info('No patches or local source files needed updating') |
1174 | else: | 1174 | else: |
1175 | # Update existing files | 1175 | # Update existing files |
1176 | for basepath, path in upd_f.iteritems(): | 1176 | for basepath, path in upd_f.items(): |
1177 | logger.info('Updating file %s' % basepath) | 1177 | logger.info('Updating file %s' % basepath) |
1178 | _move_file(os.path.join(local_files_dir, basepath), path) | 1178 | _move_file(os.path.join(local_files_dir, basepath), path) |
1179 | updatefiles = True | 1179 | updatefiles = True |
1180 | for basepath, path in upd_p.iteritems(): | 1180 | for basepath, path in upd_p.items(): |
1181 | patchfn = os.path.join(patches_dir, basepath) | 1181 | patchfn = os.path.join(patches_dir, basepath) |
1182 | if changed_revs is not None: | 1182 | if changed_revs is not None: |
1183 | # Avoid updating patches that have not actually changed | 1183 | # Avoid updating patches that have not actually changed |
@@ -1192,13 +1192,13 @@ def _update_recipe_patch(args, config, workspace, srctree, rd, config_data): | |||
1192 | # Add any new files | 1192 | # Add any new files |
1193 | files_dir = os.path.join(os.path.dirname(recipefile), | 1193 | files_dir = os.path.join(os.path.dirname(recipefile), |
1194 | rd.getVar('BPN', True)) | 1194 | rd.getVar('BPN', True)) |
1195 | for basepath, path in new_f.iteritems(): | 1195 | for basepath, path in new_f.items(): |
1196 | logger.info('Adding new file %s' % basepath) | 1196 | logger.info('Adding new file %s' % basepath) |
1197 | _move_file(os.path.join(local_files_dir, basepath), | 1197 | _move_file(os.path.join(local_files_dir, basepath), |
1198 | os.path.join(files_dir, basepath)) | 1198 | os.path.join(files_dir, basepath)) |
1199 | srcuri.append('file://%s' % basepath) | 1199 | srcuri.append('file://%s' % basepath) |
1200 | updaterecipe = True | 1200 | updaterecipe = True |
1201 | for basepath, path in new_p.iteritems(): | 1201 | for basepath, path in new_p.items(): |
1202 | logger.info('Adding new patch %s' % basepath) | 1202 | logger.info('Adding new patch %s' % basepath) |
1203 | _move_file(os.path.join(patches_dir, basepath), | 1203 | _move_file(os.path.join(patches_dir, basepath), |
1204 | os.path.join(files_dir, basepath)) | 1204 | os.path.join(files_dir, basepath)) |
@@ -1285,7 +1285,7 @@ def update_recipe(args, config, basepath, workspace): | |||
1285 | def status(args, config, basepath, workspace): | 1285 | def status(args, config, basepath, workspace): |
1286 | """Entry point for the devtool 'status' subcommand""" | 1286 | """Entry point for the devtool 'status' subcommand""" |
1287 | if workspace: | 1287 | if workspace: |
1288 | for recipe, value in workspace.iteritems(): | 1288 | for recipe, value in workspace.items(): |
1289 | recipefile = value['recipefile'] | 1289 | recipefile = value['recipefile'] |
1290 | if recipefile: | 1290 | if recipefile: |
1291 | recipestr = ' (%s)' % recipefile | 1291 | recipestr = ' (%s)' % recipefile |
diff --git a/scripts/lib/devtool/upgrade.py b/scripts/lib/devtool/upgrade.py index 07a90188f3..66e5f59a01 100644 --- a/scripts/lib/devtool/upgrade.py +++ b/scripts/lib/devtool/upgrade.py | |||
@@ -70,7 +70,7 @@ def _remove_patch_dirs(recipefolder): | |||
70 | def _recipe_contains(rd, var): | 70 | def _recipe_contains(rd, var): |
71 | rf = rd.getVar('FILE', True) | 71 | rf = rd.getVar('FILE', True) |
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.iteritems(): | 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): |
75 | return True | 75 | return True |
76 | return False | 76 | return False |
diff --git a/scripts/lib/recipetool/append.py b/scripts/lib/recipetool/append.py index 558fd25ac5..35756b08af 100644 --- a/scripts/lib/recipetool/append.py +++ b/scripts/lib/recipetool/append.py | |||
@@ -61,7 +61,7 @@ def find_target_file(targetpath, d, pkglist=None): | |||
61 | '/etc/gshadow': '/etc/gshadow should be managed through the useradd and extrausers classes', | 61 | '/etc/gshadow': '/etc/gshadow should be managed through the useradd and extrausers classes', |
62 | '${sysconfdir}/hostname': '${sysconfdir}/hostname contents should be set by setting hostname_pn-base-files = "value" in configuration',} | 62 | '${sysconfdir}/hostname': '${sysconfdir}/hostname contents should be set by setting hostname_pn-base-files = "value" in configuration',} |
63 | 63 | ||
64 | for pthspec, message in invalidtargets.iteritems(): | 64 | for pthspec, message in invalidtargets.items(): |
65 | if fnmatch.fnmatchcase(targetpath, d.expand(pthspec)): | 65 | if fnmatch.fnmatchcase(targetpath, d.expand(pthspec)): |
66 | raise InvalidTargetFileError(d.expand(message)) | 66 | raise InvalidTargetFileError(d.expand(message)) |
67 | 67 | ||
@@ -152,7 +152,7 @@ def determine_file_source(targetpath, rd): | |||
152 | # Check patches | 152 | # Check patches |
153 | srcpatches = [] | 153 | srcpatches = [] |
154 | patchedfiles = oe.recipeutils.get_recipe_patched_files(rd) | 154 | patchedfiles = oe.recipeutils.get_recipe_patched_files(rd) |
155 | for patch, filelist in patchedfiles.iteritems(): | 155 | for patch, filelist in patchedfiles.items(): |
156 | for fileitem in filelist: | 156 | for fileitem in filelist: |
157 | if fileitem[0] == srcpath: | 157 | if fileitem[0] == srcpath: |
158 | srcpatches.append((patch, fileitem[1])) | 158 | srcpatches.append((patch, fileitem[1])) |
@@ -270,7 +270,7 @@ def appendfile(args): | |||
270 | postinst_pns = [] | 270 | postinst_pns = [] |
271 | 271 | ||
272 | selectpn = None | 272 | selectpn = None |
273 | for targetpath, pnlist in recipes.iteritems(): | 273 | for targetpath, pnlist in recipes.items(): |
274 | for pn in pnlist: | 274 | for pn in pnlist: |
275 | if pn.startswith('?'): | 275 | if pn.startswith('?'): |
276 | alternative_pns.append(pn[1:]) | 276 | alternative_pns.append(pn[1:]) |
@@ -351,7 +351,7 @@ def appendsrc(args, files, rd, extralines=None): | |||
351 | 351 | ||
352 | copyfiles = {} | 352 | copyfiles = {} |
353 | extralines = extralines or [] | 353 | extralines = extralines or [] |
354 | for newfile, srcfile in files.iteritems(): | 354 | for newfile, srcfile in files.items(): |
355 | src_destdir = os.path.dirname(srcfile) | 355 | src_destdir = os.path.dirname(srcfile) |
356 | if not args.use_workdir: | 356 | if not args.use_workdir: |
357 | if rd.getVar('S', True) == rd.getVar('STAGING_KERNEL_DIR', True): | 357 | if rd.getVar('S', True) == rd.getVar('STAGING_KERNEL_DIR', True): |
diff --git a/scripts/lib/recipetool/create.py b/scripts/lib/recipetool/create.py index 4a59363eea..5a37d18209 100644 --- a/scripts/lib/recipetool/create.py +++ b/scripts/lib/recipetool/create.py | |||
@@ -61,8 +61,8 @@ class RecipeHandler(object): | |||
61 | libpaths = list(set([base_libdir, libdir])) | 61 | libpaths = list(set([base_libdir, libdir])) |
62 | libname_re = re.compile('^lib(.+)\.so.*$') | 62 | libname_re = re.compile('^lib(.+)\.so.*$') |
63 | pkglibmap = {} | 63 | pkglibmap = {} |
64 | for lib, item in shlib_providers.iteritems(): | 64 | for lib, item in shlib_providers.items(): |
65 | for path, pkg in item.iteritems(): | 65 | for path, pkg in item.items(): |
66 | if path in libpaths: | 66 | if path in libpaths: |
67 | res = libname_re.match(lib) | 67 | res = libname_re.match(lib) |
68 | if res: | 68 | if res: |
@@ -74,7 +74,7 @@ class RecipeHandler(object): | |||
74 | 74 | ||
75 | # Now turn it into a library->recipe mapping | 75 | # Now turn it into a library->recipe mapping |
76 | pkgdata_dir = d.getVar('PKGDATA_DIR', True) | 76 | pkgdata_dir = d.getVar('PKGDATA_DIR', True) |
77 | for libname, pkg in pkglibmap.iteritems(): | 77 | for libname, pkg in pkglibmap.items(): |
78 | try: | 78 | try: |
79 | with open(os.path.join(pkgdata_dir, 'runtime', pkg)) as f: | 79 | with open(os.path.join(pkgdata_dir, 'runtime', pkg)) as f: |
80 | for line in f: | 80 | for line in f: |
@@ -663,7 +663,7 @@ def create_recipe(args): | |||
663 | else: | 663 | else: |
664 | extraoutdir = os.path.join(os.path.dirname(outfile), pn) | 664 | extraoutdir = os.path.join(os.path.dirname(outfile), pn) |
665 | bb.utils.mkdirhier(extraoutdir) | 665 | bb.utils.mkdirhier(extraoutdir) |
666 | for destfn, extrafile in extrafiles.iteritems(): | 666 | for destfn, extrafile in extrafiles.items(): |
667 | shutil.move(extrafile, os.path.join(extraoutdir, destfn)) | 667 | shutil.move(extrafile, os.path.join(extraoutdir, destfn)) |
668 | 668 | ||
669 | lines = lines_before | 669 | lines = lines_before |
@@ -901,7 +901,7 @@ def split_pkg_licenses(licvalues, packages, outlines, fallback_licenses=None, pn | |||
901 | """ | 901 | """ |
902 | pkglicenses = {pn: []} | 902 | pkglicenses = {pn: []} |
903 | for license, licpath, _ in licvalues: | 903 | for license, licpath, _ in licvalues: |
904 | for pkgname, pkgpath in packages.iteritems(): | 904 | for pkgname, pkgpath in packages.items(): |
905 | if licpath.startswith(pkgpath + '/'): | 905 | if licpath.startswith(pkgpath + '/'): |
906 | if pkgname in pkglicenses: | 906 | if pkgname in pkglicenses: |
907 | pkglicenses[pkgname].append(license) | 907 | pkglicenses[pkgname].append(license) |
@@ -928,7 +928,7 @@ def read_pkgconfig_provides(d): | |||
928 | for line in f: | 928 | for line in f: |
929 | pkgmap[os.path.basename(line.rstrip())] = os.path.splitext(os.path.basename(fn))[0] | 929 | pkgmap[os.path.basename(line.rstrip())] = os.path.splitext(os.path.basename(fn))[0] |
930 | recipemap = {} | 930 | recipemap = {} |
931 | for pc, pkg in pkgmap.iteritems(): | 931 | for pc, pkg in pkgmap.items(): |
932 | pkgdatafile = os.path.join(pkgdatadir, 'runtime', pkg) | 932 | pkgdatafile = os.path.join(pkgdatadir, 'runtime', pkg) |
933 | if os.path.exists(pkgdatafile): | 933 | if os.path.exists(pkgdatafile): |
934 | with open(pkgdatafile, 'r') as f: | 934 | with open(pkgdatafile, 'r') as f: |
diff --git a/scripts/lib/recipetool/create_buildsys.py b/scripts/lib/recipetool/create_buildsys.py index ad857801d3..de3d9aed6f 100644 --- a/scripts/lib/recipetool/create_buildsys.py +++ b/scripts/lib/recipetool/create_buildsys.py | |||
@@ -44,7 +44,7 @@ class CmakeRecipeHandler(RecipeHandler): | |||
44 | classes.append('cmake') | 44 | classes.append('cmake') |
45 | values = CmakeRecipeHandler.extract_cmake_deps(lines_before, srctree, extravalues) | 45 | values = CmakeRecipeHandler.extract_cmake_deps(lines_before, srctree, extravalues) |
46 | classes.extend(values.pop('inherit', '').split()) | 46 | classes.extend(values.pop('inherit', '').split()) |
47 | for var, value in values.iteritems(): | 47 | for var, value in values.items(): |
48 | lines_before.append('%s = "%s"' % (var, value)) | 48 | lines_before.append('%s = "%s"' % (var, value)) |
49 | lines_after.append('# Specify any options you want to pass to cmake using EXTRA_OECMAKE:') | 49 | lines_after.append('# Specify any options you want to pass to cmake using EXTRA_OECMAKE:') |
50 | lines_after.append('EXTRA_OECMAKE = ""') | 50 | lines_after.append('EXTRA_OECMAKE = ""') |
@@ -159,7 +159,7 @@ class CmakeRecipeHandler(RecipeHandler): | |||
159 | 159 | ||
160 | def find_cmake_package(pkg): | 160 | def find_cmake_package(pkg): |
161 | RecipeHandler.load_devel_filemap(tinfoil.config_data) | 161 | RecipeHandler.load_devel_filemap(tinfoil.config_data) |
162 | for fn, pn in RecipeHandler.recipecmakefilemap.iteritems(): | 162 | for fn, pn in RecipeHandler.recipecmakefilemap.items(): |
163 | splitname = fn.split('/') | 163 | splitname = fn.split('/') |
164 | if len(splitname) > 1: | 164 | if len(splitname) > 1: |
165 | if splitname[0].lower().startswith(pkg.lower()): | 165 | if splitname[0].lower().startswith(pkg.lower()): |
@@ -348,7 +348,7 @@ class AutotoolsRecipeHandler(RecipeHandler): | |||
348 | autoconf = True | 348 | autoconf = True |
349 | values = AutotoolsRecipeHandler.extract_autotools_deps(lines_before, srctree, extravalues) | 349 | values = AutotoolsRecipeHandler.extract_autotools_deps(lines_before, srctree, extravalues) |
350 | classes.extend(values.pop('inherit', '').split()) | 350 | classes.extend(values.pop('inherit', '').split()) |
351 | for var, value in values.iteritems(): | 351 | for var, value in values.items(): |
352 | lines_before.append('%s = "%s"' % (var, value)) | 352 | lines_before.append('%s = "%s"' % (var, value)) |
353 | else: | 353 | else: |
354 | conffile = RecipeHandler.checkfiles(srctree, ['configure']) | 354 | conffile = RecipeHandler.checkfiles(srctree, ['configure']) |
@@ -446,7 +446,7 @@ class AutotoolsRecipeHandler(RecipeHandler): | |||
446 | defines = {} | 446 | defines = {} |
447 | def subst_defines(value): | 447 | def subst_defines(value): |
448 | newvalue = value | 448 | newvalue = value |
449 | for define, defval in defines.iteritems(): | 449 | for define, defval in defines.items(): |
450 | newvalue = newvalue.replace(define, defval) | 450 | newvalue = newvalue.replace(define, defval) |
451 | if newvalue != value: | 451 | if newvalue != value: |
452 | return subst_defines(newvalue) | 452 | return subst_defines(newvalue) |
@@ -753,7 +753,7 @@ class MakefileRecipeHandler(RecipeHandler): | |||
753 | if scanfile and os.path.exists(scanfile): | 753 | if scanfile and os.path.exists(scanfile): |
754 | values = AutotoolsRecipeHandler.extract_autotools_deps(lines_before, srctree, acfile=scanfile) | 754 | values = AutotoolsRecipeHandler.extract_autotools_deps(lines_before, srctree, acfile=scanfile) |
755 | classes.extend(values.pop('inherit', '').split()) | 755 | classes.extend(values.pop('inherit', '').split()) |
756 | for var, value in values.iteritems(): | 756 | for var, value in values.items(): |
757 | if var == 'DEPENDS': | 757 | if var == 'DEPENDS': |
758 | lines_before.append('# NOTE: some of these dependencies may be optional, check the Makefile and/or upstream documentation') | 758 | lines_before.append('# NOTE: some of these dependencies may be optional, check the Makefile and/or upstream documentation') |
759 | lines_before.append('%s = "%s"' % (var, value)) | 759 | lines_before.append('%s = "%s"' % (var, value)) |
diff --git a/scripts/lib/recipetool/create_buildsys_python.py b/scripts/lib/recipetool/create_buildsys_python.py index c3823307a4..cc3b5a45fd 100644 --- a/scripts/lib/recipetool/create_buildsys_python.py +++ b/scripts/lib/recipetool/create_buildsys_python.py | |||
@@ -238,7 +238,7 @@ class PythonRecipeHandler(RecipeHandler): | |||
238 | 238 | ||
239 | # Map PKG-INFO & setup.py fields to bitbake variables | 239 | # Map PKG-INFO & setup.py fields to bitbake variables |
240 | bbinfo = {} | 240 | bbinfo = {} |
241 | for field, values in info.iteritems(): | 241 | for field, values in info.items(): |
242 | if field in self.excluded_fields: | 242 | if field in self.excluded_fields: |
243 | continue | 243 | continue |
244 | 244 | ||
@@ -294,8 +294,8 @@ class PythonRecipeHandler(RecipeHandler): | |||
294 | lines_after.append('# The upstream names may not correspond exactly to bitbake package names.') | 294 | lines_after.append('# The upstream names may not correspond exactly to bitbake package names.') |
295 | lines_after.append('#') | 295 | lines_after.append('#') |
296 | lines_after.append('# Uncomment this line to enable all the optional features.') | 296 | lines_after.append('# Uncomment this line to enable all the optional features.') |
297 | lines_after.append('#PACKAGECONFIG ?= "{}"'.format(' '.join(k.lower() for k in extras_req.iterkeys()))) | 297 | lines_after.append('#PACKAGECONFIG ?= "{}"'.format(' '.join(k.lower() for k in extras_req))) |
298 | for feature, feature_reqs in extras_req.iteritems(): | 298 | for feature, feature_reqs in extras_req.items(): |
299 | unmapped_deps.difference_update(feature_reqs) | 299 | unmapped_deps.difference_update(feature_reqs) |
300 | 300 | ||
301 | feature_req_deps = ('python-' + r.replace('.', '-').lower() for r in sorted(feature_reqs)) | 301 | feature_req_deps = ('python-' + r.replace('.', '-').lower() for r in sorted(feature_reqs)) |
@@ -442,8 +442,8 @@ class PythonRecipeHandler(RecipeHandler): | |||
442 | del info[variable] | 442 | del info[variable] |
443 | elif new_value != value: | 443 | elif new_value != value: |
444 | info[variable] = new_value | 444 | info[variable] = new_value |
445 | elif hasattr(value, 'iteritems'): | 445 | elif hasattr(value, 'items'): |
446 | for dkey, dvalue in value.iteritems(): | 446 | for dkey, dvalue in value.items(): |
447 | new_list = [] | 447 | new_list = [] |
448 | for pos, a_value in enumerate(dvalue): | 448 | for pos, a_value in enumerate(dvalue): |
449 | new_value = replace_value(search, replace, a_value) | 449 | new_value = replace_value(search, replace, a_value) |
@@ -558,7 +558,7 @@ class PythonRecipeHandler(RecipeHandler): | |||
558 | else: | 558 | else: |
559 | continue | 559 | continue |
560 | 560 | ||
561 | for fn in files_info.iterkeys(): | 561 | for fn in files_info: |
562 | for suffix in suffixes: | 562 | for suffix in suffixes: |
563 | if fn.endswith(suffix): | 563 | if fn.endswith(suffix): |
564 | break | 564 | break |
@@ -640,7 +640,7 @@ class SetupScriptVisitor(ast.NodeVisitor): | |||
640 | def visit_setup(self, node): | 640 | def visit_setup(self, node): |
641 | call = LiteralAstTransform().visit(node) | 641 | call = LiteralAstTransform().visit(node) |
642 | self.keywords = call.keywords | 642 | self.keywords = call.keywords |
643 | for k, v in self.keywords.iteritems(): | 643 | for k, v in self.keywords.items(): |
644 | if has_non_literals(v): | 644 | if has_non_literals(v): |
645 | self.non_literals.append(k) | 645 | self.non_literals.append(k) |
646 | 646 | ||
@@ -708,8 +708,8 @@ def has_non_literals(value): | |||
708 | return True | 708 | return True |
709 | elif isinstance(value, basestring): | 709 | elif isinstance(value, basestring): |
710 | return False | 710 | return False |
711 | elif hasattr(value, 'itervalues'): | 711 | elif hasattr(value, 'values'): |
712 | return any(has_non_literals(v) for v in value.itervalues()) | 712 | return any(has_non_literals(v) for v in value.values()) |
713 | elif hasattr(value, '__iter__'): | 713 | elif hasattr(value, '__iter__'): |
714 | return any(has_non_literals(v) for v in value) | 714 | return any(has_non_literals(v) for v in value) |
715 | 715 | ||
diff --git a/scripts/lib/recipetool/create_npm.py b/scripts/lib/recipetool/create_npm.py index ffbcb4905c..fcc0172af8 100644 --- a/scripts/lib/recipetool/create_npm.py +++ b/scripts/lib/recipetool/create_npm.py | |||
@@ -128,7 +128,7 @@ class NpmRecipeHandler(RecipeHandler): | |||
128 | license = self._handle_license(data) | 128 | license = self._handle_license(data) |
129 | if license: | 129 | if license: |
130 | licenses['${PN}'] = license | 130 | licenses['${PN}'] = license |
131 | for pkgname, pkgitem in npmpackages.iteritems(): | 131 | for pkgname, pkgitem in npmpackages.items(): |
132 | _, pdata = pkgitem | 132 | _, pdata = pkgitem |
133 | license = self._handle_license(pdata) | 133 | license = self._handle_license(pdata) |
134 | if license: | 134 | if license: |
@@ -136,7 +136,7 @@ class NpmRecipeHandler(RecipeHandler): | |||
136 | # Now write out the package-specific license values | 136 | # Now write out the package-specific license values |
137 | # We need to strip out the json data dicts for this since split_pkg_licenses | 137 | # We need to strip out the json data dicts for this since split_pkg_licenses |
138 | # isn't expecting it | 138 | # isn't expecting it |
139 | packages = OrderedDict((x,y[0]) for x,y in npmpackages.iteritems()) | 139 | packages = OrderedDict((x,y[0]) for x,y in npmpackages.items()) |
140 | packages['${PN}'] = '' | 140 | packages['${PN}'] = '' |
141 | pkglicenses = split_pkg_licenses(licvalues, packages, lines_after, licenses) | 141 | pkglicenses = split_pkg_licenses(licvalues, packages, lines_after, licenses) |
142 | all_licenses = list(set([item for pkglicense in pkglicenses.values() for item in pkglicense])) | 142 | all_licenses = list(set([item for pkglicense in pkglicenses.values() for item in pkglicense])) |
diff --git a/scripts/pythondeps b/scripts/pythondeps index ff92e747ed..f1e6452092 100755 --- a/scripts/pythondeps +++ b/scripts/pythondeps | |||
@@ -187,7 +187,7 @@ def get_depends_recursive(directory): | |||
187 | directory = os.path.realpath(directory) | 187 | directory = os.path.realpath(directory) |
188 | 188 | ||
189 | provides = dict((v, k) for k, v in get_provides(directory)) | 189 | provides = dict((v, k) for k, v in get_provides(directory)) |
190 | for filename, provide in provides.iteritems(): | 190 | for filename, provide in provides.items(): |
191 | if os.path.isdir(filename): | 191 | if os.path.isdir(filename): |
192 | filename = os.path.join(filename, '__init__.py') | 192 | filename = os.path.join(filename, '__init__.py') |
193 | ispkg = True | 193 | ispkg = True |