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>
This commit is contained in:
parent
63404baadb
commit
7eab022d4b
|
@ -194,7 +194,7 @@ def patch_recipe_lines(fromlines, values, trailing_newline=True):
|
||||||
remainingnames = {}
|
remainingnames = {}
|
||||||
for k in values.keys():
|
for k in values.keys():
|
||||||
remainingnames[k] = get_recipe_pos(k)
|
remainingnames[k] = get_recipe_pos(k)
|
||||||
remainingnames = OrderedDict(sorted(remainingnames.iteritems(), key=lambda x: x[1]))
|
remainingnames = OrderedDict(sorted(remainingnames.items(), key=lambda x: x[1]))
|
||||||
|
|
||||||
modifying = False
|
modifying = False
|
||||||
|
|
||||||
|
@ -234,7 +234,7 @@ def patch_recipe_lines(fromlines, values, trailing_newline=True):
|
||||||
if modifying:
|
if modifying:
|
||||||
# Insert anything that should come before this variable
|
# Insert anything that should come before this variable
|
||||||
pos = get_recipe_pos(varname)
|
pos = get_recipe_pos(varname)
|
||||||
for k in remainingnames.keys()[:]:
|
for k in list(remainingnames):
|
||||||
if remainingnames[k] > -1 and pos >= remainingnames[k] and not k in existingnames:
|
if remainingnames[k] > -1 and pos >= remainingnames[k] and not k in existingnames:
|
||||||
outputvalue(k, newlines, rewindcomments=True)
|
outputvalue(k, newlines, rewindcomments=True)
|
||||||
del remainingnames[k]
|
del remainingnames[k]
|
||||||
|
|
|
@ -103,7 +103,7 @@ def main():
|
||||||
if options.reportall or value != orig:
|
if options.reportall or value != orig:
|
||||||
all_srcrevs[curdir].append((pn, name, srcrev))
|
all_srcrevs[curdir].append((pn, name, srcrev))
|
||||||
|
|
||||||
for curdir, srcrevs in sorted(all_srcrevs.iteritems()):
|
for curdir, srcrevs in sorted(all_srcrevs.items()):
|
||||||
if srcrevs:
|
if srcrevs:
|
||||||
print('# %s' % curdir)
|
print('# %s' % curdir)
|
||||||
for pn, name, srcrev in srcrevs:
|
for pn, name, srcrev in srcrevs:
|
||||||
|
|
|
@ -1178,7 +1178,7 @@ def update_with_history(conf, components, revisions, repos):
|
||||||
# components imported head revision.
|
# components imported head revision.
|
||||||
if additional_heads:
|
if additional_heads:
|
||||||
runcmd("git reset --hard", **wargs)
|
runcmd("git reset --hard", **wargs)
|
||||||
for rev, base in additional_heads.iteritems():
|
for rev, base in additional_heads.items():
|
||||||
apply_commit(base, rev, wargs, wargs, None)
|
apply_commit(base, rev, wargs, wargs, None)
|
||||||
|
|
||||||
# Commit with all component branches as parents as well as the previous head.
|
# Commit with all component branches as parents as well as the previous head.
|
||||||
|
|
|
@ -59,8 +59,8 @@ def collect_bbvars(metadir):
|
||||||
for root,dirs,files in os.walk(metadir):
|
for root,dirs,files in os.walk(metadir):
|
||||||
for name in files:
|
for name in files:
|
||||||
if name.find(".bb") >= 0:
|
if name.find(".bb") >= 0:
|
||||||
for key in recipe_bbvars(os.path.join(root,name)).iterkeys():
|
for key in recipe_bbvars(os.path.join(root,name)).keys():
|
||||||
if bbvars.has_key(key):
|
if key in bbvars:
|
||||||
bbvars[key] = bbvars[key] + 1
|
bbvars[key] = bbvars[key] + 1
|
||||||
else:
|
else:
|
||||||
bbvars[key] = 1
|
bbvars[key] = 1
|
||||||
|
@ -155,15 +155,15 @@ def main():
|
||||||
|
|
||||||
# Collect all the variable names from the recipes in the metadirs
|
# Collect all the variable names from the recipes in the metadirs
|
||||||
for m in metadirs:
|
for m in metadirs:
|
||||||
for key,cnt in collect_bbvars(m).iteritems():
|
for key,cnt in collect_bbvars(m).items():
|
||||||
if bbvars.has_key(key):
|
if key in bbvars:
|
||||||
bbvars[key] = bbvars[key] + cnt
|
bbvars[key] = bbvars[key] + cnt
|
||||||
else:
|
else:
|
||||||
bbvars[key] = cnt
|
bbvars[key] = cnt
|
||||||
|
|
||||||
# Check each var for documentation
|
# Check each var for documentation
|
||||||
varlen = 0
|
varlen = 0
|
||||||
for v in bbvars.iterkeys():
|
for v in bbvars.keys():
|
||||||
if len(v) > varlen:
|
if len(v) > varlen:
|
||||||
varlen = len(v)
|
varlen = len(v)
|
||||||
if not bbvar_is_documented(v, docfiles):
|
if not bbvar_is_documented(v, docfiles):
|
||||||
|
|
|
@ -86,7 +86,7 @@ def collect_flags(pkg_dict):
|
||||||
''' Collect available PACKAGECONFIG flags and all affected pkgs '''
|
''' Collect available PACKAGECONFIG flags and all affected pkgs '''
|
||||||
# flag_dict = {'flag': ['pkg1', 'pkg2',...]}
|
# flag_dict = {'flag': ['pkg1', 'pkg2',...]}
|
||||||
flag_dict = {}
|
flag_dict = {}
|
||||||
for pkgname, flaglist in pkg_dict.iteritems():
|
for pkgname, flaglist in pkg_dict.items():
|
||||||
for flag in flaglist:
|
for flag in flaglist:
|
||||||
if flag in flag_dict:
|
if flag in flag_dict:
|
||||||
flag_dict[flag].append(pkgname)
|
flag_dict[flag].append(pkgname)
|
||||||
|
@ -132,7 +132,7 @@ def display_all(data_dict):
|
||||||
packageconfig = 'None'
|
packageconfig = 'None'
|
||||||
print('PACKAGECONFIG %s' % packageconfig)
|
print('PACKAGECONFIG %s' % packageconfig)
|
||||||
|
|
||||||
for flag,flag_val in data_dict[fn].getVarFlags("PACKAGECONFIG").iteritems():
|
for flag,flag_val in data_dict[fn].getVarFlags("PACKAGECONFIG").items():
|
||||||
if flag == "doc":
|
if flag == "doc":
|
||||||
continue
|
continue
|
||||||
print('PACKAGECONFIG[%s] %s' % (flag, flag_val))
|
print('PACKAGECONFIG[%s] %s' % (flag, flag_val))
|
||||||
|
|
|
@ -97,7 +97,7 @@ class MakefileMaker:
|
||||||
# generate package variables
|
# generate package variables
|
||||||
#
|
#
|
||||||
|
|
||||||
for name, data in sorted(self.packages.iteritems()):
|
for name, data in sorted(self.packages.items()):
|
||||||
desc, deps, files = data
|
desc, deps, files = data
|
||||||
|
|
||||||
#
|
#
|
||||||
|
@ -130,7 +130,7 @@ class MakefileMaker:
|
||||||
self.out( 'SUMMARY_${PN}-modules="All Python modules"' )
|
self.out( 'SUMMARY_${PN}-modules="All Python modules"' )
|
||||||
line = 'RDEPENDS_${PN}-modules="'
|
line = 'RDEPENDS_${PN}-modules="'
|
||||||
|
|
||||||
for name, data in sorted(self.packages.iteritems()):
|
for name, data in sorted(self.packages.items()):
|
||||||
if name not in ['${PN}-dev', '${PN}-distutils-staticdev']:
|
if name not in ['${PN}-dev', '${PN}-distutils-staticdev']:
|
||||||
line += "%s " % name
|
line += "%s " % name
|
||||||
|
|
||||||
|
|
|
@ -100,7 +100,7 @@ class MakefileMaker:
|
||||||
# generate package variables
|
# generate package variables
|
||||||
#
|
#
|
||||||
|
|
||||||
for name, data in sorted(self.packages.iteritems()):
|
for name, data in sorted(self.packages.items()):
|
||||||
desc, deps, files = data
|
desc, deps, files = data
|
||||||
|
|
||||||
#
|
#
|
||||||
|
@ -133,7 +133,7 @@ class MakefileMaker:
|
||||||
self.out( 'SUMMARY_${PN}-modules="All Python modules"' )
|
self.out( 'SUMMARY_${PN}-modules="All Python modules"' )
|
||||||
line = 'RDEPENDS_${PN}-modules="'
|
line = 'RDEPENDS_${PN}-modules="'
|
||||||
|
|
||||||
for name, data in sorted(self.packages.iteritems()):
|
for name, data in sorted(self.packages.items()):
|
||||||
if name not in ['${PN}-dev', '${PN}-distutils-staticdev']:
|
if name not in ['${PN}-dev', '${PN}-distutils-staticdev']:
|
||||||
line += "%s " % name
|
line += "%s " % name
|
||||||
|
|
||||||
|
|
|
@ -155,7 +155,7 @@ def check_workspace_recipe(workspace, pn, checksrc=True, bbclassextend=False):
|
||||||
|
|
||||||
workspacepn = pn
|
workspacepn = pn
|
||||||
|
|
||||||
for recipe, value in workspace.iteritems():
|
for recipe, value in workspace.items():
|
||||||
if recipe == pn:
|
if recipe == pn:
|
||||||
break
|
break
|
||||||
if bbclassextend:
|
if bbclassextend:
|
||||||
|
|
|
@ -1091,11 +1091,11 @@ def _update_recipe_srcrev(args, srctree, rd, config_data):
|
||||||
else:
|
else:
|
||||||
files_dir = os.path.join(os.path.dirname(recipefile),
|
files_dir = os.path.join(os.path.dirname(recipefile),
|
||||||
rd.getVar('BPN', True))
|
rd.getVar('BPN', True))
|
||||||
for basepath, path in upd_f.iteritems():
|
for basepath, path in upd_f.items():
|
||||||
logger.info('Updating file %s' % basepath)
|
logger.info('Updating file %s' % basepath)
|
||||||
_move_file(os.path.join(local_files_dir, basepath), path)
|
_move_file(os.path.join(local_files_dir, basepath), path)
|
||||||
update_srcuri= True
|
update_srcuri= True
|
||||||
for basepath, path in new_f.iteritems():
|
for basepath, path in new_f.items():
|
||||||
logger.info('Adding new file %s' % basepath)
|
logger.info('Adding new file %s' % basepath)
|
||||||
_move_file(os.path.join(local_files_dir, basepath),
|
_move_file(os.path.join(local_files_dir, basepath),
|
||||||
os.path.join(files_dir, basepath))
|
os.path.join(files_dir, basepath))
|
||||||
|
@ -1173,11 +1173,11 @@ def _update_recipe_patch(args, config, workspace, srctree, rd, config_data):
|
||||||
logger.info('No patches or local source files needed updating')
|
logger.info('No patches or local source files needed updating')
|
||||||
else:
|
else:
|
||||||
# Update existing files
|
# Update existing files
|
||||||
for basepath, path in upd_f.iteritems():
|
for basepath, path in upd_f.items():
|
||||||
logger.info('Updating file %s' % basepath)
|
logger.info('Updating file %s' % basepath)
|
||||||
_move_file(os.path.join(local_files_dir, basepath), path)
|
_move_file(os.path.join(local_files_dir, basepath), path)
|
||||||
updatefiles = True
|
updatefiles = True
|
||||||
for basepath, path in upd_p.iteritems():
|
for basepath, path in upd_p.items():
|
||||||
patchfn = os.path.join(patches_dir, basepath)
|
patchfn = os.path.join(patches_dir, basepath)
|
||||||
if changed_revs is not None:
|
if changed_revs is not None:
|
||||||
# Avoid updating patches that have not actually changed
|
# Avoid updating patches that have not actually changed
|
||||||
|
@ -1192,13 +1192,13 @@ def _update_recipe_patch(args, config, workspace, srctree, rd, config_data):
|
||||||
# Add any new files
|
# Add any new files
|
||||||
files_dir = os.path.join(os.path.dirname(recipefile),
|
files_dir = os.path.join(os.path.dirname(recipefile),
|
||||||
rd.getVar('BPN', True))
|
rd.getVar('BPN', True))
|
||||||
for basepath, path in new_f.iteritems():
|
for basepath, path in new_f.items():
|
||||||
logger.info('Adding new file %s' % basepath)
|
logger.info('Adding new file %s' % basepath)
|
||||||
_move_file(os.path.join(local_files_dir, basepath),
|
_move_file(os.path.join(local_files_dir, basepath),
|
||||||
os.path.join(files_dir, basepath))
|
os.path.join(files_dir, basepath))
|
||||||
srcuri.append('file://%s' % basepath)
|
srcuri.append('file://%s' % basepath)
|
||||||
updaterecipe = True
|
updaterecipe = True
|
||||||
for basepath, path in new_p.iteritems():
|
for basepath, path in new_p.items():
|
||||||
logger.info('Adding new patch %s' % basepath)
|
logger.info('Adding new patch %s' % basepath)
|
||||||
_move_file(os.path.join(patches_dir, basepath),
|
_move_file(os.path.join(patches_dir, basepath),
|
||||||
os.path.join(files_dir, basepath))
|
os.path.join(files_dir, basepath))
|
||||||
|
@ -1285,7 +1285,7 @@ def update_recipe(args, config, basepath, workspace):
|
||||||
def status(args, config, basepath, workspace):
|
def status(args, config, basepath, workspace):
|
||||||
"""Entry point for the devtool 'status' subcommand"""
|
"""Entry point for the devtool 'status' subcommand"""
|
||||||
if workspace:
|
if workspace:
|
||||||
for recipe, value in workspace.iteritems():
|
for recipe, value in workspace.items():
|
||||||
recipefile = value['recipefile']
|
recipefile = value['recipefile']
|
||||||
if recipefile:
|
if recipefile:
|
||||||
recipestr = ' (%s)' % recipefile
|
recipestr = ' (%s)' % recipefile
|
||||||
|
|
|
@ -70,7 +70,7 @@ def _remove_patch_dirs(recipefolder):
|
||||||
def _recipe_contains(rd, var):
|
def _recipe_contains(rd, var):
|
||||||
rf = rd.getVar('FILE', True)
|
rf = rd.getVar('FILE', True)
|
||||||
varfiles = oe.recipeutils.get_var_files(rf, [var], rd)
|
varfiles = oe.recipeutils.get_var_files(rf, [var], rd)
|
||||||
for var, fn in varfiles.iteritems():
|
for var, fn in varfiles.items():
|
||||||
if fn and fn.startswith(os.path.dirname(rf) + os.sep):
|
if fn and fn.startswith(os.path.dirname(rf) + os.sep):
|
||||||
return True
|
return True
|
||||||
return False
|
return False
|
||||||
|
|
|
@ -61,7 +61,7 @@ def find_target_file(targetpath, d, pkglist=None):
|
||||||
'/etc/gshadow': '/etc/gshadow should be managed through the useradd and extrausers classes',
|
'/etc/gshadow': '/etc/gshadow should be managed through the useradd and extrausers classes',
|
||||||
'${sysconfdir}/hostname': '${sysconfdir}/hostname contents should be set by setting hostname_pn-base-files = "value" in configuration',}
|
'${sysconfdir}/hostname': '${sysconfdir}/hostname contents should be set by setting hostname_pn-base-files = "value" in configuration',}
|
||||||
|
|
||||||
for pthspec, message in invalidtargets.iteritems():
|
for pthspec, message in invalidtargets.items():
|
||||||
if fnmatch.fnmatchcase(targetpath, d.expand(pthspec)):
|
if fnmatch.fnmatchcase(targetpath, d.expand(pthspec)):
|
||||||
raise InvalidTargetFileError(d.expand(message))
|
raise InvalidTargetFileError(d.expand(message))
|
||||||
|
|
||||||
|
@ -152,7 +152,7 @@ def determine_file_source(targetpath, rd):
|
||||||
# Check patches
|
# Check patches
|
||||||
srcpatches = []
|
srcpatches = []
|
||||||
patchedfiles = oe.recipeutils.get_recipe_patched_files(rd)
|
patchedfiles = oe.recipeutils.get_recipe_patched_files(rd)
|
||||||
for patch, filelist in patchedfiles.iteritems():
|
for patch, filelist in patchedfiles.items():
|
||||||
for fileitem in filelist:
|
for fileitem in filelist:
|
||||||
if fileitem[0] == srcpath:
|
if fileitem[0] == srcpath:
|
||||||
srcpatches.append((patch, fileitem[1]))
|
srcpatches.append((patch, fileitem[1]))
|
||||||
|
@ -270,7 +270,7 @@ def appendfile(args):
|
||||||
postinst_pns = []
|
postinst_pns = []
|
||||||
|
|
||||||
selectpn = None
|
selectpn = None
|
||||||
for targetpath, pnlist in recipes.iteritems():
|
for targetpath, pnlist in recipes.items():
|
||||||
for pn in pnlist:
|
for pn in pnlist:
|
||||||
if pn.startswith('?'):
|
if pn.startswith('?'):
|
||||||
alternative_pns.append(pn[1:])
|
alternative_pns.append(pn[1:])
|
||||||
|
@ -351,7 +351,7 @@ def appendsrc(args, files, rd, extralines=None):
|
||||||
|
|
||||||
copyfiles = {}
|
copyfiles = {}
|
||||||
extralines = extralines or []
|
extralines = extralines or []
|
||||||
for newfile, srcfile in files.iteritems():
|
for newfile, srcfile in files.items():
|
||||||
src_destdir = os.path.dirname(srcfile)
|
src_destdir = os.path.dirname(srcfile)
|
||||||
if not args.use_workdir:
|
if not args.use_workdir:
|
||||||
if rd.getVar('S', True) == rd.getVar('STAGING_KERNEL_DIR', True):
|
if rd.getVar('S', True) == rd.getVar('STAGING_KERNEL_DIR', True):
|
||||||
|
|
|
@ -61,8 +61,8 @@ class RecipeHandler(object):
|
||||||
libpaths = list(set([base_libdir, libdir]))
|
libpaths = list(set([base_libdir, libdir]))
|
||||||
libname_re = re.compile('^lib(.+)\.so.*$')
|
libname_re = re.compile('^lib(.+)\.so.*$')
|
||||||
pkglibmap = {}
|
pkglibmap = {}
|
||||||
for lib, item in shlib_providers.iteritems():
|
for lib, item in shlib_providers.items():
|
||||||
for path, pkg in item.iteritems():
|
for path, pkg in item.items():
|
||||||
if path in libpaths:
|
if path in libpaths:
|
||||||
res = libname_re.match(lib)
|
res = libname_re.match(lib)
|
||||||
if res:
|
if res:
|
||||||
|
@ -74,7 +74,7 @@ class RecipeHandler(object):
|
||||||
|
|
||||||
# Now turn it into a library->recipe mapping
|
# Now turn it into a library->recipe mapping
|
||||||
pkgdata_dir = d.getVar('PKGDATA_DIR', True)
|
pkgdata_dir = d.getVar('PKGDATA_DIR', True)
|
||||||
for libname, pkg in pkglibmap.iteritems():
|
for libname, pkg in pkglibmap.items():
|
||||||
try:
|
try:
|
||||||
with open(os.path.join(pkgdata_dir, 'runtime', pkg)) as f:
|
with open(os.path.join(pkgdata_dir, 'runtime', pkg)) as f:
|
||||||
for line in f:
|
for line in f:
|
||||||
|
@ -663,7 +663,7 @@ def create_recipe(args):
|
||||||
else:
|
else:
|
||||||
extraoutdir = os.path.join(os.path.dirname(outfile), pn)
|
extraoutdir = os.path.join(os.path.dirname(outfile), pn)
|
||||||
bb.utils.mkdirhier(extraoutdir)
|
bb.utils.mkdirhier(extraoutdir)
|
||||||
for destfn, extrafile in extrafiles.iteritems():
|
for destfn, extrafile in extrafiles.items():
|
||||||
shutil.move(extrafile, os.path.join(extraoutdir, destfn))
|
shutil.move(extrafile, os.path.join(extraoutdir, destfn))
|
||||||
|
|
||||||
lines = lines_before
|
lines = lines_before
|
||||||
|
@ -901,7 +901,7 @@ def split_pkg_licenses(licvalues, packages, outlines, fallback_licenses=None, pn
|
||||||
"""
|
"""
|
||||||
pkglicenses = {pn: []}
|
pkglicenses = {pn: []}
|
||||||
for license, licpath, _ in licvalues:
|
for license, licpath, _ in licvalues:
|
||||||
for pkgname, pkgpath in packages.iteritems():
|
for pkgname, pkgpath in packages.items():
|
||||||
if licpath.startswith(pkgpath + '/'):
|
if licpath.startswith(pkgpath + '/'):
|
||||||
if pkgname in pkglicenses:
|
if pkgname in pkglicenses:
|
||||||
pkglicenses[pkgname].append(license)
|
pkglicenses[pkgname].append(license)
|
||||||
|
@ -928,7 +928,7 @@ def read_pkgconfig_provides(d):
|
||||||
for line in f:
|
for line in f:
|
||||||
pkgmap[os.path.basename(line.rstrip())] = os.path.splitext(os.path.basename(fn))[0]
|
pkgmap[os.path.basename(line.rstrip())] = os.path.splitext(os.path.basename(fn))[0]
|
||||||
recipemap = {}
|
recipemap = {}
|
||||||
for pc, pkg in pkgmap.iteritems():
|
for pc, pkg in pkgmap.items():
|
||||||
pkgdatafile = os.path.join(pkgdatadir, 'runtime', pkg)
|
pkgdatafile = os.path.join(pkgdatadir, 'runtime', pkg)
|
||||||
if os.path.exists(pkgdatafile):
|
if os.path.exists(pkgdatafile):
|
||||||
with open(pkgdatafile, 'r') as f:
|
with open(pkgdatafile, 'r') as f:
|
||||||
|
|
|
@ -44,7 +44,7 @@ class CmakeRecipeHandler(RecipeHandler):
|
||||||
classes.append('cmake')
|
classes.append('cmake')
|
||||||
values = CmakeRecipeHandler.extract_cmake_deps(lines_before, srctree, extravalues)
|
values = CmakeRecipeHandler.extract_cmake_deps(lines_before, srctree, extravalues)
|
||||||
classes.extend(values.pop('inherit', '').split())
|
classes.extend(values.pop('inherit', '').split())
|
||||||
for var, value in values.iteritems():
|
for var, value in values.items():
|
||||||
lines_before.append('%s = "%s"' % (var, value))
|
lines_before.append('%s = "%s"' % (var, value))
|
||||||
lines_after.append('# Specify any options you want to pass to cmake using EXTRA_OECMAKE:')
|
lines_after.append('# Specify any options you want to pass to cmake using EXTRA_OECMAKE:')
|
||||||
lines_after.append('EXTRA_OECMAKE = ""')
|
lines_after.append('EXTRA_OECMAKE = ""')
|
||||||
|
@ -159,7 +159,7 @@ class CmakeRecipeHandler(RecipeHandler):
|
||||||
|
|
||||||
def find_cmake_package(pkg):
|
def find_cmake_package(pkg):
|
||||||
RecipeHandler.load_devel_filemap(tinfoil.config_data)
|
RecipeHandler.load_devel_filemap(tinfoil.config_data)
|
||||||
for fn, pn in RecipeHandler.recipecmakefilemap.iteritems():
|
for fn, pn in RecipeHandler.recipecmakefilemap.items():
|
||||||
splitname = fn.split('/')
|
splitname = fn.split('/')
|
||||||
if len(splitname) > 1:
|
if len(splitname) > 1:
|
||||||
if splitname[0].lower().startswith(pkg.lower()):
|
if splitname[0].lower().startswith(pkg.lower()):
|
||||||
|
@ -348,7 +348,7 @@ class AutotoolsRecipeHandler(RecipeHandler):
|
||||||
autoconf = True
|
autoconf = True
|
||||||
values = AutotoolsRecipeHandler.extract_autotools_deps(lines_before, srctree, extravalues)
|
values = AutotoolsRecipeHandler.extract_autotools_deps(lines_before, srctree, extravalues)
|
||||||
classes.extend(values.pop('inherit', '').split())
|
classes.extend(values.pop('inherit', '').split())
|
||||||
for var, value in values.iteritems():
|
for var, value in values.items():
|
||||||
lines_before.append('%s = "%s"' % (var, value))
|
lines_before.append('%s = "%s"' % (var, value))
|
||||||
else:
|
else:
|
||||||
conffile = RecipeHandler.checkfiles(srctree, ['configure'])
|
conffile = RecipeHandler.checkfiles(srctree, ['configure'])
|
||||||
|
@ -446,7 +446,7 @@ class AutotoolsRecipeHandler(RecipeHandler):
|
||||||
defines = {}
|
defines = {}
|
||||||
def subst_defines(value):
|
def subst_defines(value):
|
||||||
newvalue = value
|
newvalue = value
|
||||||
for define, defval in defines.iteritems():
|
for define, defval in defines.items():
|
||||||
newvalue = newvalue.replace(define, defval)
|
newvalue = newvalue.replace(define, defval)
|
||||||
if newvalue != value:
|
if newvalue != value:
|
||||||
return subst_defines(newvalue)
|
return subst_defines(newvalue)
|
||||||
|
@ -753,7 +753,7 @@ class MakefileRecipeHandler(RecipeHandler):
|
||||||
if scanfile and os.path.exists(scanfile):
|
if scanfile and os.path.exists(scanfile):
|
||||||
values = AutotoolsRecipeHandler.extract_autotools_deps(lines_before, srctree, acfile=scanfile)
|
values = AutotoolsRecipeHandler.extract_autotools_deps(lines_before, srctree, acfile=scanfile)
|
||||||
classes.extend(values.pop('inherit', '').split())
|
classes.extend(values.pop('inherit', '').split())
|
||||||
for var, value in values.iteritems():
|
for var, value in values.items():
|
||||||
if var == 'DEPENDS':
|
if var == 'DEPENDS':
|
||||||
lines_before.append('# NOTE: some of these dependencies may be optional, check the Makefile and/or upstream documentation')
|
lines_before.append('# NOTE: some of these dependencies may be optional, check the Makefile and/or upstream documentation')
|
||||||
lines_before.append('%s = "%s"' % (var, value))
|
lines_before.append('%s = "%s"' % (var, value))
|
||||||
|
|
|
@ -238,7 +238,7 @@ class PythonRecipeHandler(RecipeHandler):
|
||||||
|
|
||||||
# Map PKG-INFO & setup.py fields to bitbake variables
|
# Map PKG-INFO & setup.py fields to bitbake variables
|
||||||
bbinfo = {}
|
bbinfo = {}
|
||||||
for field, values in info.iteritems():
|
for field, values in info.items():
|
||||||
if field in self.excluded_fields:
|
if field in self.excluded_fields:
|
||||||
continue
|
continue
|
||||||
|
|
||||||
|
@ -294,8 +294,8 @@ class PythonRecipeHandler(RecipeHandler):
|
||||||
lines_after.append('# The upstream names may not correspond exactly to bitbake package names.')
|
lines_after.append('# The upstream names may not correspond exactly to bitbake package names.')
|
||||||
lines_after.append('#')
|
lines_after.append('#')
|
||||||
lines_after.append('# Uncomment this line to enable all the optional features.')
|
lines_after.append('# Uncomment this line to enable all the optional features.')
|
||||||
lines_after.append('#PACKAGECONFIG ?= "{}"'.format(' '.join(k.lower() for k in extras_req.iterkeys())))
|
lines_after.append('#PACKAGECONFIG ?= "{}"'.format(' '.join(k.lower() for k in extras_req)))
|
||||||
for feature, feature_reqs in extras_req.iteritems():
|
for feature, feature_reqs in extras_req.items():
|
||||||
unmapped_deps.difference_update(feature_reqs)
|
unmapped_deps.difference_update(feature_reqs)
|
||||||
|
|
||||||
feature_req_deps = ('python-' + r.replace('.', '-').lower() for r in sorted(feature_reqs))
|
feature_req_deps = ('python-' + r.replace('.', '-').lower() for r in sorted(feature_reqs))
|
||||||
|
@ -442,8 +442,8 @@ class PythonRecipeHandler(RecipeHandler):
|
||||||
del info[variable]
|
del info[variable]
|
||||||
elif new_value != value:
|
elif new_value != value:
|
||||||
info[variable] = new_value
|
info[variable] = new_value
|
||||||
elif hasattr(value, 'iteritems'):
|
elif hasattr(value, 'items'):
|
||||||
for dkey, dvalue in value.iteritems():
|
for dkey, dvalue in value.items():
|
||||||
new_list = []
|
new_list = []
|
||||||
for pos, a_value in enumerate(dvalue):
|
for pos, a_value in enumerate(dvalue):
|
||||||
new_value = replace_value(search, replace, a_value)
|
new_value = replace_value(search, replace, a_value)
|
||||||
|
@ -558,7 +558,7 @@ class PythonRecipeHandler(RecipeHandler):
|
||||||
else:
|
else:
|
||||||
continue
|
continue
|
||||||
|
|
||||||
for fn in files_info.iterkeys():
|
for fn in files_info:
|
||||||
for suffix in suffixes:
|
for suffix in suffixes:
|
||||||
if fn.endswith(suffix):
|
if fn.endswith(suffix):
|
||||||
break
|
break
|
||||||
|
@ -640,7 +640,7 @@ class SetupScriptVisitor(ast.NodeVisitor):
|
||||||
def visit_setup(self, node):
|
def visit_setup(self, node):
|
||||||
call = LiteralAstTransform().visit(node)
|
call = LiteralAstTransform().visit(node)
|
||||||
self.keywords = call.keywords
|
self.keywords = call.keywords
|
||||||
for k, v in self.keywords.iteritems():
|
for k, v in self.keywords.items():
|
||||||
if has_non_literals(v):
|
if has_non_literals(v):
|
||||||
self.non_literals.append(k)
|
self.non_literals.append(k)
|
||||||
|
|
||||||
|
@ -708,8 +708,8 @@ def has_non_literals(value):
|
||||||
return True
|
return True
|
||||||
elif isinstance(value, basestring):
|
elif isinstance(value, basestring):
|
||||||
return False
|
return False
|
||||||
elif hasattr(value, 'itervalues'):
|
elif hasattr(value, 'values'):
|
||||||
return any(has_non_literals(v) for v in value.itervalues())
|
return any(has_non_literals(v) for v in value.values())
|
||||||
elif hasattr(value, '__iter__'):
|
elif hasattr(value, '__iter__'):
|
||||||
return any(has_non_literals(v) for v in value)
|
return any(has_non_literals(v) for v in value)
|
||||||
|
|
||||||
|
|
|
@ -128,7 +128,7 @@ class NpmRecipeHandler(RecipeHandler):
|
||||||
license = self._handle_license(data)
|
license = self._handle_license(data)
|
||||||
if license:
|
if license:
|
||||||
licenses['${PN}'] = license
|
licenses['${PN}'] = license
|
||||||
for pkgname, pkgitem in npmpackages.iteritems():
|
for pkgname, pkgitem in npmpackages.items():
|
||||||
_, pdata = pkgitem
|
_, pdata = pkgitem
|
||||||
license = self._handle_license(pdata)
|
license = self._handle_license(pdata)
|
||||||
if license:
|
if license:
|
||||||
|
@ -136,7 +136,7 @@ class NpmRecipeHandler(RecipeHandler):
|
||||||
# Now write out the package-specific license values
|
# Now write out the package-specific license values
|
||||||
# We need to strip out the json data dicts for this since split_pkg_licenses
|
# We need to strip out the json data dicts for this since split_pkg_licenses
|
||||||
# isn't expecting it
|
# isn't expecting it
|
||||||
packages = OrderedDict((x,y[0]) for x,y in npmpackages.iteritems())
|
packages = OrderedDict((x,y[0]) for x,y in npmpackages.items())
|
||||||
packages['${PN}'] = ''
|
packages['${PN}'] = ''
|
||||||
pkglicenses = split_pkg_licenses(licvalues, packages, lines_after, licenses)
|
pkglicenses = split_pkg_licenses(licvalues, packages, lines_after, licenses)
|
||||||
all_licenses = list(set([item for pkglicense in pkglicenses.values() for item in pkglicense]))
|
all_licenses = list(set([item for pkglicense in pkglicenses.values() for item in pkglicense]))
|
||||||
|
|
|
@ -187,7 +187,7 @@ def get_depends_recursive(directory):
|
||||||
directory = os.path.realpath(directory)
|
directory = os.path.realpath(directory)
|
||||||
|
|
||||||
provides = dict((v, k) for k, v in get_provides(directory))
|
provides = dict((v, k) for k, v in get_provides(directory))
|
||||||
for filename, provide in provides.iteritems():
|
for filename, provide in provides.items():
|
||||||
if os.path.isdir(filename):
|
if os.path.isdir(filename):
|
||||||
filename = os.path.join(filename, '__init__.py')
|
filename = os.path.join(filename, '__init__.py')
|
||||||
ispkg = True
|
ispkg = True
|
||||||
|
|
Loading…
Reference in New Issue