scripts: remove True option to getVar calls

getVar() now defaults to expanding by default, thus remove the True
option from getVar() calls with a regex search and replace.

Search made with the following regex: getVar ?\(( ?[^,()]*), True\)

(From OE-Core rev: 0a36bd96e6b29fd99a296efc358ca3e9fb5af735)

Signed-off-by: Joshua Lock <joshua.g.lock@intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
Joshua Lock 2016-12-14 21:13:05 +00:00 committed by Richard Purdie
parent c4e2c59088
commit c0f2890c01
22 changed files with 106 additions and 106 deletions

View File

@ -76,7 +76,7 @@ def collect_pkgs(data_dict):
for fn in data_dict: for fn in data_dict:
pkgconfigflags = data_dict[fn].getVarFlags("PACKAGECONFIG") pkgconfigflags = data_dict[fn].getVarFlags("PACKAGECONFIG")
pkgconfigflags.pop('doc', None) pkgconfigflags.pop('doc', None)
pkgname = data_dict[fn].getVar("P", True) pkgname = data_dict[fn].getVar("P")
pkg_dict[pkgname] = sorted(pkgconfigflags.keys()) pkg_dict[pkgname] = sorted(pkgconfigflags.keys())
return pkg_dict return pkg_dict
@ -124,9 +124,9 @@ def display_all(data_dict):
''' Display all pkgs and PACKAGECONFIG information ''' ''' Display all pkgs and PACKAGECONFIG information '''
print(str("").ljust(50, '=')) print(str("").ljust(50, '='))
for fn in data_dict: for fn in data_dict:
print('%s' % data_dict[fn].getVar("P", True)) print('%s' % data_dict[fn].getVar("P"))
print(fn) print(fn)
packageconfig = data_dict[fn].getVar("PACKAGECONFIG", True) or '' packageconfig = data_dict[fn].getVar("PACKAGECONFIG") or ''
if packageconfig.strip() == '': if packageconfig.strip() == '':
packageconfig = 'None' packageconfig = 'None'
print('PACKAGECONFIG %s' % packageconfig) print('PACKAGECONFIG %s' % packageconfig)

View File

@ -44,7 +44,7 @@ def verifyHomepage(bbhandler):
if realfn in checked: if realfn in checked:
continue continue
data = bbhandler.parse_recipe_file(realfn) data = bbhandler.parse_recipe_file(realfn)
homepage = data.getVar("HOMEPAGE", True) homepage = data.getVar("HOMEPAGE")
if homepage: if homepage:
try: try:
urllib.request.urlopen(homepage, timeout=5) urllib.request.urlopen(homepage, timeout=5)

View File

@ -291,7 +291,7 @@ def main():
try: try:
tinfoil = setup_tinfoil(config_only=True, basepath=basepath) tinfoil = setup_tinfoil(config_only=True, basepath=basepath)
try: try:
global_args.bbpath = tinfoil.config_data.getVar('BBPATH', True) global_args.bbpath = tinfoil.config_data.getVar('BBPATH')
finally: finally:
tinfoil.shutdown() tinfoil.shutdown()
except bb.BBHandledException: except bb.BBHandledException:

View File

@ -87,13 +87,13 @@ def exec_watch(cmd, **options):
def exec_fakeroot(d, cmd, **kwargs): def exec_fakeroot(d, cmd, **kwargs):
"""Run a command under fakeroot (pseudo, in fact) so that it picks up the appropriate file permissions""" """Run a command under fakeroot (pseudo, in fact) so that it picks up the appropriate file permissions"""
# Grab the command and check it actually exists # Grab the command and check it actually exists
fakerootcmd = d.getVar('FAKEROOTCMD', True) fakerootcmd = d.getVar('FAKEROOTCMD')
if not os.path.exists(fakerootcmd): if not os.path.exists(fakerootcmd):
logger.error('pseudo executable %s could not be found - have you run a build yet? pseudo-native should install this and if you have run any build then that should have been built') logger.error('pseudo executable %s could not be found - have you run a build yet? pseudo-native should install this and if you have run any build then that should have been built')
return 2 return 2
# Set up the appropriate environment # Set up the appropriate environment
newenv = dict(os.environ) newenv = dict(os.environ)
fakerootenv = d.getVar('FAKEROOTENV', True) fakerootenv = d.getVar('FAKEROOTENV')
for varvalue in fakerootenv.split(): for varvalue in fakerootenv.split():
if '=' in varvalue: if '=' in varvalue:
splitval = varvalue.split('=', 1) splitval = varvalue.split('=', 1)
@ -179,7 +179,7 @@ def use_external_build(same_dir, no_same_dir, d):
logger.info('Using source tree as build directory since --same-dir specified') logger.info('Using source tree as build directory since --same-dir specified')
elif bb.data.inherits_class('autotools-brokensep', d): elif bb.data.inherits_class('autotools-brokensep', d):
logger.info('Using source tree as build directory since recipe inherits autotools-brokensep') logger.info('Using source tree as build directory since recipe inherits autotools-brokensep')
elif d.getVar('B', True) == os.path.abspath(d.getVar('S', True)): elif d.getVar('B') == os.path.abspath(d.getVar('S')):
logger.info('Using source tree as build directory since that would be the default for this recipe') logger.info('Using source tree as build directory since that would be the default for this recipe')
else: else:
b_is_s = False b_is_s = False
@ -256,7 +256,7 @@ def ensure_npm(config, basepath, fixed_setup=False):
""" """
tinfoil = setup_tinfoil(config_only=True, basepath=basepath) tinfoil = setup_tinfoil(config_only=True, basepath=basepath)
try: try:
nativepath = tinfoil.config_data.getVar('STAGING_BINDIR_NATIVE', True) nativepath = tinfoil.config_data.getVar('STAGING_BINDIR_NATIVE')
finally: finally:
tinfoil.shutdown() tinfoil.shutdown()

View File

@ -34,8 +34,8 @@ def _get_packages(tinfoil, workspace, config):
result = [] result = []
for recipe in workspace: for recipe in workspace:
data = parse_recipe(config, tinfoil, recipe, True) data = parse_recipe(config, tinfoil, recipe, True)
if 'class-target' in data.getVar('OVERRIDES', True).split(':'): if 'class-target' in data.getVar('OVERRIDES').split(':'):
if recipe in data.getVar('PACKAGES', True).split(): if recipe in data.getVar('PACKAGES').split():
result.append(recipe) result.append(recipe)
else: else:
logger.warning("Skipping recipe %s as it doesn't produce a " logger.warning("Skipping recipe %s as it doesn't produce a "
@ -95,7 +95,7 @@ def build_image_task(config, basepath, workspace, image, add_packages=None, task
raise TargetNotImageError() raise TargetNotImageError()
# Get the actual filename used and strip the .bb and full path # Get the actual filename used and strip the .bb and full path
target_basename = rd.getVar('FILE', True) target_basename = rd.getVar('FILE')
target_basename = os.path.splitext(os.path.basename(target_basename))[0] target_basename = os.path.splitext(os.path.basename(target_basename))[0]
config.set('SDK', 'target_basename', target_basename) config.set('SDK', 'target_basename', target_basename)
config.write() config.write()
@ -132,9 +132,9 @@ def build_image_task(config, basepath, workspace, image, add_packages=None, task
afile.write('%s\n' % line) afile.write('%s\n' % line)
if task in ['populate_sdk', 'populate_sdk_ext']: if task in ['populate_sdk', 'populate_sdk_ext']:
outputdir = rd.getVar('SDK_DEPLOY', True) outputdir = rd.getVar('SDK_DEPLOY')
else: else:
outputdir = rd.getVar('DEPLOY_DIR_IMAGE', True) outputdir = rd.getVar('DEPLOY_DIR_IMAGE')
tmp_tinfoil = tinfoil tmp_tinfoil = tinfoil
tinfoil = None tinfoil = None

View File

@ -160,7 +160,7 @@ def deploy(args, config, basepath, workspace):
except Exception as e: except Exception as e:
raise DevtoolError('Exception parsing recipe %s: %s' % raise DevtoolError('Exception parsing recipe %s: %s' %
(args.recipename, e)) (args.recipename, e))
recipe_outdir = rd.getVar('D', True) recipe_outdir = rd.getVar('D')
if not os.path.exists(recipe_outdir) or not os.listdir(recipe_outdir): if not os.path.exists(recipe_outdir) or not os.listdir(recipe_outdir):
raise DevtoolError('No files to deploy - have you built the %s ' raise DevtoolError('No files to deploy - have you built the %s '
'recipe? If so, the install step has not installed ' 'recipe? If so, the install step has not installed '

View File

@ -32,7 +32,7 @@ def package(args, config, basepath, workspace):
try: try:
image_pkgtype = config.get('Package', 'image_pkgtype', '') image_pkgtype = config.get('Package', 'image_pkgtype', '')
if not image_pkgtype: if not image_pkgtype:
image_pkgtype = tinfoil.config_data.getVar('IMAGE_PKGTYPE', True) image_pkgtype = tinfoil.config_data.getVar('IMAGE_PKGTYPE')
deploy_dir_pkg = tinfoil.config_data.getVar('DEPLOY_DIR_%s' % image_pkgtype.upper(), True) deploy_dir_pkg = tinfoil.config_data.getVar('DEPLOY_DIR_%s' % image_pkgtype.upper(), True)
finally: finally:

View File

@ -31,8 +31,8 @@ def runqemu(args, config, basepath, workspace):
tinfoil = setup_tinfoil(config_only=True, basepath=basepath) tinfoil = setup_tinfoil(config_only=True, basepath=basepath)
try: try:
machine = tinfoil.config_data.getVar('MACHINE', True) machine = tinfoil.config_data.getVar('MACHINE')
bindir_native = tinfoil.config_data.getVar('STAGING_BINDIR_NATIVE', True) bindir_native = tinfoil.config_data.getVar('STAGING_BINDIR_NATIVE')
finally: finally:
tinfoil.shutdown() tinfoil.shutdown()

View File

@ -132,9 +132,9 @@ def sdk_update(args, config, basepath, workspace):
# Grab variable values # Grab variable values
tinfoil = setup_tinfoil(config_only=True, basepath=basepath) tinfoil = setup_tinfoil(config_only=True, basepath=basepath)
try: try:
stamps_dir = tinfoil.config_data.getVar('STAMPS_DIR', True) stamps_dir = tinfoil.config_data.getVar('STAMPS_DIR')
sstate_mirrors = tinfoil.config_data.getVar('SSTATE_MIRRORS', True) sstate_mirrors = tinfoil.config_data.getVar('SSTATE_MIRRORS')
site_conf_version = tinfoil.config_data.getVar('SITE_CONF_VERSION', True) site_conf_version = tinfoil.config_data.getVar('SITE_CONF_VERSION')
finally: finally:
tinfoil.shutdown() tinfoil.shutdown()
@ -273,7 +273,7 @@ def sdk_install(args, config, basepath, workspace):
rd = parse_recipe(config, tinfoil, recipe, True) rd = parse_recipe(config, tinfoil, recipe, True)
if not rd: if not rd:
return 1 return 1
stampprefixes[recipe] = '%s.%s' % (rd.getVar('STAMP', True), tasks[0]) stampprefixes[recipe] = '%s.%s' % (rd.getVar('STAMP'), tasks[0])
if checkstamp(recipe): if checkstamp(recipe):
logger.info('%s is already installed' % recipe) logger.info('%s is already installed' % recipe)
else: else:

View File

@ -31,7 +31,7 @@ def search(args, config, basepath, workspace):
tinfoil = setup_tinfoil(config_only=False, basepath=basepath) tinfoil = setup_tinfoil(config_only=False, basepath=basepath)
try: try:
pkgdata_dir = tinfoil.config_data.getVar('PKGDATA_DIR', True) pkgdata_dir = tinfoil.config_data.getVar('PKGDATA_DIR')
defsummary = tinfoil.config_data.getVar('SUMMARY', False) or '' defsummary = tinfoil.config_data.getVar('SUMMARY', False) or ''
keyword_rc = re.compile(args.keyword) keyword_rc = re.compile(args.keyword)
@ -70,7 +70,7 @@ def search(args, config, basepath, workspace):
if match: if match:
rd = parse_recipe(config, tinfoil, fn, True) rd = parse_recipe(config, tinfoil, fn, True)
summary = rd.getVar('SUMMARY', True) summary = rd.getVar('SUMMARY')
if summary == rd.expand(defsummary): if summary == rd.expand(defsummary):
summary = '' summary = ''
print("%s %s" % (fn.ljust(20), summary)) print("%s %s" % (fn.ljust(20), summary))

View File

@ -303,7 +303,7 @@ def _check_compatible_recipe(pn, d):
raise DevtoolError("The %s recipe is a meta-recipe, and therefore is " raise DevtoolError("The %s recipe is a meta-recipe, and therefore is "
"not supported by this tool" % pn, 4) "not supported by this tool" % pn, 4)
if bb.data.inherits_class('externalsrc', d) and d.getVar('EXTERNALSRC', True): if bb.data.inherits_class('externalsrc', d) and d.getVar('EXTERNALSRC'):
# Not an incompatibility error per se, so we don't pass the error code # Not an incompatibility error per se, so we don't pass the error code
raise DevtoolError("externalsrc is currently enabled for the %s " raise DevtoolError("externalsrc is currently enabled for the %s "
"recipe. This prevents the normal do_patch task " "recipe. This prevents the normal do_patch task "
@ -439,7 +439,7 @@ def _extract_source(srctree, keep_temp, devbranch, sync, d, tinfoil):
"""Extract sources of a recipe""" """Extract sources of a recipe"""
import oe.recipeutils import oe.recipeutils
pn = d.getVar('PN', True) pn = d.getVar('PN')
_check_compatible_recipe(pn, d) _check_compatible_recipe(pn, d)
@ -473,13 +473,13 @@ def _extract_source(srctree, keep_temp, devbranch, sync, d, tinfoil):
# Make a subdir so we guard against WORKDIR==S # Make a subdir so we guard against WORKDIR==S
workdir = os.path.join(tempdir, 'workdir') workdir = os.path.join(tempdir, 'workdir')
crd.setVar('WORKDIR', workdir) crd.setVar('WORKDIR', workdir)
if not crd.getVar('S', True).startswith(workdir): if not crd.getVar('S').startswith(workdir):
# Usually a shared workdir recipe (kernel, gcc) # Usually a shared workdir recipe (kernel, gcc)
# Try to set a reasonable default # Try to set a reasonable default
if bb.data.inherits_class('kernel', d): if bb.data.inherits_class('kernel', d):
crd.setVar('S', '${WORKDIR}/source') crd.setVar('S', '${WORKDIR}/source')
else: else:
crd.setVar('S', '${WORKDIR}/%s' % os.path.basename(d.getVar('S', True))) crd.setVar('S', '${WORKDIR}/%s' % os.path.basename(d.getVar('S')))
if bb.data.inherits_class('kernel', d): if bb.data.inherits_class('kernel', d):
# We don't want to move the source to STAGING_KERNEL_DIR here # We don't want to move the source to STAGING_KERNEL_DIR here
crd.setVar('STAGING_KERNEL_DIR', '${S}') crd.setVar('STAGING_KERNEL_DIR', '${S}')
@ -533,7 +533,7 @@ def _extract_source(srctree, keep_temp, devbranch, sync, d, tinfoil):
# Extra step for kernel to populate the source directory # Extra step for kernel to populate the source directory
runtask(fn, 'kernel_checkout') runtask(fn, 'kernel_checkout')
srcsubdir = crd.getVar('S', True) srcsubdir = crd.getVar('S')
# Move local source files into separate subdir # Move local source files into separate subdir
recipe_patches = [os.path.basename(patch) for patch in recipe_patches = [os.path.basename(patch) for patch in
@ -581,7 +581,7 @@ def _extract_source(srctree, keep_temp, devbranch, sync, d, tinfoil):
"doesn't use any source or the correct source " "doesn't use any source or the correct source "
"directory could not be determined" % pn) "directory could not be determined" % pn)
setup_git_repo(srcsubdir, crd.getVar('PV', True), devbranch, d=d) setup_git_repo(srcsubdir, crd.getVar('PV'), devbranch, d=d)
(stdout, _) = bb.process.run('git rev-parse HEAD', cwd=srcsubdir) (stdout, _) = bb.process.run('git rev-parse HEAD', cwd=srcsubdir)
initial_rev = stdout.rstrip() initial_rev = stdout.rstrip()
@ -596,7 +596,7 @@ def _extract_source(srctree, keep_temp, devbranch, sync, d, tinfoil):
# Store generate and store kernel config # Store generate and store kernel config
logger.info('Generating kernel config') logger.info('Generating kernel config')
runtask(fn, 'configure') runtask(fn, 'configure')
kconfig = os.path.join(crd.getVar('B', True), '.config') kconfig = os.path.join(crd.getVar('B'), '.config')
tempdir_localdir = os.path.join(tempdir, 'oe-local-files') tempdir_localdir = os.path.join(tempdir, 'oe-local-files')
@ -628,7 +628,7 @@ def _extract_source(srctree, keep_temp, devbranch, sync, d, tinfoil):
shutil.move(srcsubdir, srctree) shutil.move(srcsubdir, srctree)
if os.path.abspath(d.getVar('S', True)) == os.path.abspath(d.getVar('WORKDIR', True)): if os.path.abspath(d.getVar('S')) == os.path.abspath(d.getVar('WORKDIR')):
# If recipe extracts to ${WORKDIR}, symlink the files into the srctree # If recipe extracts to ${WORKDIR}, symlink the files into the srctree
# (otherwise the recipe won't build as expected) # (otherwise the recipe won't build as expected)
local_files_dir = os.path.join(srctree, 'oe-local-files') local_files_dir = os.path.join(srctree, 'oe-local-files')
@ -725,7 +725,7 @@ def modify(args, config, basepath, workspace):
if not rd: if not rd:
return 1 return 1
pn = rd.getVar('PN', True) pn = rd.getVar('PN')
if pn != args.recipename: if pn != args.recipename:
logger.info('Mapping %s to %s' % (args.recipename, pn)) logger.info('Mapping %s to %s' % (args.recipename, pn))
if pn in workspace: if pn in workspace:
@ -747,7 +747,7 @@ def modify(args, config, basepath, workspace):
# Error already shown # Error already shown
return 1 return 1
recipefile = rd.getVar('FILE', True) recipefile = rd.getVar('FILE')
appendfile = recipe_to_append(recipefile, config, args.wildcard) appendfile = recipe_to_append(recipefile, config, args.wildcard)
if os.path.exists(appendfile): if os.path.exists(appendfile):
raise DevtoolError("Another variant of recipe %s is already in your " raise DevtoolError("Another variant of recipe %s is already in your "
@ -784,8 +784,8 @@ def modify(args, config, basepath, workspace):
initial_rev = stdout.rstrip() initial_rev = stdout.rstrip()
# Check that recipe isn't using a shared workdir # Check that recipe isn't using a shared workdir
s = os.path.abspath(rd.getVar('S', True)) s = os.path.abspath(rd.getVar('S'))
workdir = os.path.abspath(rd.getVar('WORKDIR', True)) workdir = os.path.abspath(rd.getVar('WORKDIR'))
if s.startswith(workdir) and s != workdir and os.path.dirname(s) != workdir: if s.startswith(workdir) and s != workdir and os.path.dirname(s) != workdir:
# Handle if S is set to a subdirectory of the source # Handle if S is set to a subdirectory of the source
srcsubdir = os.path.relpath(s, workdir).split(os.sep, 1)[1] srcsubdir = os.path.relpath(s, workdir).split(os.sep, 1)[1]
@ -866,17 +866,17 @@ def rename(args, config, basepath, workspace):
if not rd: if not rd:
return 1 return 1
bp = rd.getVar('BP', True) bp = rd.getVar('BP')
bpn = rd.getVar('BPN', True) bpn = rd.getVar('BPN')
if newname != args.recipename: if newname != args.recipename:
localdata = rd.createCopy() localdata = rd.createCopy()
localdata.setVar('PN', newname) localdata.setVar('PN', newname)
newbpn = localdata.getVar('BPN', True) newbpn = localdata.getVar('BPN')
else: else:
newbpn = bpn newbpn = bpn
s = rd.getVar('S', False) s = rd.getVar('S', False)
src_uri = rd.getVar('SRC_URI', False) src_uri = rd.getVar('SRC_URI', False)
pv = rd.getVar('PV', True) pv = rd.getVar('PV')
# Correct variable values that refer to the upstream source - these # Correct variable values that refer to the upstream source - these
# values must stay the same, so if the name/version are changing then # values must stay the same, so if the name/version are changing then
@ -1277,8 +1277,8 @@ def _export_local_files(srctree, rd, destdir):
elif fname != '.gitignore': elif fname != '.gitignore':
added[fname] = None added[fname] = None
workdir = rd.getVar('WORKDIR', True) workdir = rd.getVar('WORKDIR')
s = rd.getVar('S', True) s = rd.getVar('S')
if not s.endswith(os.sep): if not s.endswith(os.sep):
s += os.sep s += os.sep
@ -1300,14 +1300,14 @@ def _export_local_files(srctree, rd, destdir):
def _determine_files_dir(rd): def _determine_files_dir(rd):
"""Determine the appropriate files directory for a recipe""" """Determine the appropriate files directory for a recipe"""
recipedir = rd.getVar('FILE_DIRNAME', True) recipedir = rd.getVar('FILE_DIRNAME')
for entry in rd.getVar('FILESPATH', True).split(':'): for entry in rd.getVar('FILESPATH').split(':'):
relpth = os.path.relpath(entry, recipedir) relpth = os.path.relpath(entry, recipedir)
if not os.sep in relpth: if not os.sep in relpth:
# One (or zero) levels below only, so we don't put anything in machine-specific directories # One (or zero) levels below only, so we don't put anything in machine-specific directories
if os.path.isdir(entry): if os.path.isdir(entry):
return entry return entry
return os.path.join(recipedir, rd.getVar('BPN', True)) return os.path.join(recipedir, rd.getVar('BPN'))
def _update_recipe_srcrev(srctree, rd, appendlayerdir, wildcard_version, no_remove): def _update_recipe_srcrev(srctree, rd, appendlayerdir, wildcard_version, no_remove):
@ -1315,7 +1315,7 @@ def _update_recipe_srcrev(srctree, rd, appendlayerdir, wildcard_version, no_remo
import bb import bb
import oe.recipeutils import oe.recipeutils
recipefile = rd.getVar('FILE', True) recipefile = rd.getVar('FILE')
logger.info('Updating SRCREV in recipe %s' % os.path.basename(recipefile)) logger.info('Updating SRCREV in recipe %s' % os.path.basename(recipefile))
# Get HEAD revision # Get HEAD revision
@ -1397,7 +1397,7 @@ def _update_recipe_patch(recipename, workspace, srctree, rd, appendlayerdir, wil
import bb import bb
import oe.recipeutils import oe.recipeutils
recipefile = rd.getVar('FILE', True) recipefile = rd.getVar('FILE')
append = workspace[recipename]['bbappend'] append = workspace[recipename]['bbappend']
if not os.path.exists(append): if not os.path.exists(append):
raise DevtoolError('unable to find workspace bbappend for recipe %s' % raise DevtoolError('unable to find workspace bbappend for recipe %s' %
@ -1408,7 +1408,7 @@ def _update_recipe_patch(recipename, workspace, srctree, rd, appendlayerdir, wil
raise DevtoolError('Unable to find initial revision - please specify ' raise DevtoolError('Unable to find initial revision - please specify '
'it with --initial-rev') 'it with --initial-rev')
dl_dir = rd.getVar('DL_DIR', True) dl_dir = rd.getVar('DL_DIR')
if not dl_dir.endswith('/'): if not dl_dir.endswith('/'):
dl_dir += '/' dl_dir += '/'
@ -1567,7 +1567,7 @@ def update_recipe(args, config, basepath, workspace):
updated = _update_recipe(args.recipename, workspace, rd, args.mode, args.append, args.wildcard_version, args.no_remove, args.initial_rev) updated = _update_recipe(args.recipename, workspace, rd, args.mode, args.append, args.wildcard_version, args.no_remove, args.initial_rev)
if updated: if updated:
rf = rd.getVar('FILE', True) rf = rd.getVar('FILE')
if rf.startswith(config.workspace_path): if rf.startswith(config.workspace_path):
logger.warn('Recipe file %s has been updated but is inside the workspace - you will need to move it (and any associated files next to it) out to the desired layer before using "devtool reset" in order to keep any changes' % rf) logger.warn('Recipe file %s has been updated but is inside the workspace - you will need to move it (and any associated files next to it) out to the desired layer before using "devtool reset" in order to keep any changes' % rf)
finally: finally:
@ -1671,7 +1671,7 @@ def reset(args, config, basepath, workspace):
def _get_layer(layername, d): def _get_layer(layername, d):
"""Determine the base layer path for the specified layer name/path""" """Determine the base layer path for the specified layer name/path"""
layerdirs = d.getVar('BBLAYERS', True).split() layerdirs = d.getVar('BBLAYERS').split()
layers = {os.path.basename(p): p for p in layerdirs} layers = {os.path.basename(p): p for p in layerdirs}
# Provide some shortcuts # Provide some shortcuts
if layername.lower() in ['oe-core', 'openembedded-core']: if layername.lower() in ['oe-core', 'openembedded-core']:
@ -1697,7 +1697,7 @@ def finish(args, config, basepath, workspace):
return 1 return 1
destlayerdir = _get_layer(args.destination, tinfoil.config_data) destlayerdir = _get_layer(args.destination, tinfoil.config_data)
origlayerdir = oe.recipeutils.find_layerdir(rd.getVar('FILE', True)) origlayerdir = oe.recipeutils.find_layerdir(rd.getVar('FILE'))
if not os.path.isdir(destlayerdir): if not os.path.isdir(destlayerdir):
raise DevtoolError('Unable to find layer or directory matching "%s"' % args.destination) raise DevtoolError('Unable to find layer or directory matching "%s"' % args.destination)
@ -1728,7 +1728,7 @@ def finish(args, config, basepath, workspace):
if not destpath: if not destpath:
raise DevtoolError("Unable to determine destination layer path - check that %s specifies an actual layer and %s/conf/layer.conf specifies BBFILES. You may also need to specify a more complete path." % (args.destination, destlayerdir)) raise DevtoolError("Unable to determine destination layer path - check that %s specifies an actual layer and %s/conf/layer.conf specifies BBFILES. You may also need to specify a more complete path." % (args.destination, destlayerdir))
# Warn if the layer isn't in bblayers.conf (the code to create a bbappend will do this in other cases) # Warn if the layer isn't in bblayers.conf (the code to create a bbappend will do this in other cases)
layerdirs = [os.path.abspath(layerdir) for layerdir in rd.getVar('BBLAYERS', True).split()] layerdirs = [os.path.abspath(layerdir) for layerdir in rd.getVar('BBLAYERS').split()]
if not os.path.abspath(destlayerdir) in layerdirs: if not os.path.abspath(destlayerdir) in layerdirs:
bb.warn('Specified destination layer is not currently enabled in bblayers.conf, so the %s recipe will now be unavailable in your current configuration until you add the layer there' % args.recipename) bb.warn('Specified destination layer is not currently enabled in bblayers.conf, so the %s recipe will now be unavailable in your current configuration until you add the layer there' % args.recipename)
@ -1758,7 +1758,7 @@ def finish(args, config, basepath, workspace):
# associated files to the specified layer # associated files to the specified layer
no_clean = True no_clean = True
logger.info('Moving recipe file to %s' % destpath) logger.info('Moving recipe file to %s' % destpath)
recipedir = os.path.dirname(rd.getVar('FILE', True)) recipedir = os.path.dirname(rd.getVar('FILE'))
for root, _, files in os.walk(recipedir): for root, _, files in os.walk(recipedir):
for fn in files: for fn in files:
srcpath = os.path.join(root, fn) srcpath = os.path.join(root, fn)

View File

@ -68,7 +68,7 @@ def _remove_patch_dirs(recipefolder):
shutil.rmtree(os.path.join(root,d)) shutil.rmtree(os.path.join(root,d))
def _recipe_contains(rd, var): def _recipe_contains(rd, var):
rf = rd.getVar('FILE', True) rf = rd.getVar('FILE')
varfiles = oe.recipeutils.get_var_files(rf, [var], rd) varfiles = oe.recipeutils.get_var_files(rf, [var], rd)
for var, fn in varfiles.items(): 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):
@ -132,7 +132,7 @@ def _write_append(rc, srctree, same_dir, no_same_dir, rev, copied, workspace, d)
if rev: if rev:
f.write('# initial_rev: %s\n' % rev) f.write('# initial_rev: %s\n' % rev)
if copied: if copied:
f.write('# original_path: %s\n' % os.path.dirname(d.getVar('FILE', True))) f.write('# original_path: %s\n' % os.path.dirname(d.getVar('FILE')))
f.write('# original_files: %s\n' % ' '.join(copied)) f.write('# original_files: %s\n' % ' '.join(copied))
return af return af
@ -154,7 +154,7 @@ def _upgrade_error(e, rf, srctree):
raise DevtoolError(e) raise DevtoolError(e)
def _get_uri(rd): def _get_uri(rd):
srcuris = rd.getVar('SRC_URI', True).split() srcuris = rd.getVar('SRC_URI').split()
if not len(srcuris): if not len(srcuris):
raise DevtoolError('SRC_URI not found on recipe') raise DevtoolError('SRC_URI not found on recipe')
# Get first non-local entry in SRC_URI - usually by convention it's # Get first non-local entry in SRC_URI - usually by convention it's
@ -185,7 +185,7 @@ def _extract_new_source(newpv, srctree, no_patch, srcrev, branch, keep_temp, tin
crd = rd.createCopy() crd = rd.createCopy()
pv = crd.getVar('PV', True) pv = crd.getVar('PV')
crd.setVar('PV', newpv) crd.setVar('PV', newpv)
tmpsrctree = None tmpsrctree = None
@ -270,15 +270,15 @@ def _extract_new_source(newpv, srctree, no_patch, srcrev, branch, keep_temp, tin
def _create_new_recipe(newpv, md5, sha256, srcrev, srcbranch, workspace, tinfoil, rd): def _create_new_recipe(newpv, md5, sha256, srcrev, srcbranch, workspace, tinfoil, rd):
"""Creates the new recipe under workspace""" """Creates the new recipe under workspace"""
bpn = rd.getVar('BPN', True) bpn = rd.getVar('BPN')
path = os.path.join(workspace, 'recipes', bpn) path = os.path.join(workspace, 'recipes', bpn)
bb.utils.mkdirhier(path) bb.utils.mkdirhier(path)
copied, _ = oe.recipeutils.copy_recipe_files(rd, path) copied, _ = oe.recipeutils.copy_recipe_files(rd, path)
oldpv = rd.getVar('PV', True) oldpv = rd.getVar('PV')
if not newpv: if not newpv:
newpv = oldpv newpv = oldpv
origpath = rd.getVar('FILE', True) origpath = rd.getVar('FILE')
fullpath = _rename_recipe_files(origpath, bpn, oldpv, newpv, path) fullpath = _rename_recipe_files(origpath, bpn, oldpv, newpv, path)
logger.debug('Upgraded %s => %s' % (origpath, fullpath)) logger.debug('Upgraded %s => %s' % (origpath, fullpath))
@ -341,7 +341,7 @@ def upgrade(args, config, basepath, workspace):
if not rd: if not rd:
return 1 return 1
pn = rd.getVar('PN', True) pn = rd.getVar('PN')
if pn != args.recipename: if pn != args.recipename:
logger.info('Mapping %s to %s' % (args.recipename, pn)) logger.info('Mapping %s to %s' % (args.recipename, pn))
if pn in workspace: if pn in workspace:
@ -353,12 +353,12 @@ def upgrade(args, config, basepath, workspace):
srctree = standard.get_default_srctree(config, pn) srctree = standard.get_default_srctree(config, pn)
standard._check_compatible_recipe(pn, rd) standard._check_compatible_recipe(pn, rd)
old_srcrev = rd.getVar('SRCREV', True) old_srcrev = rd.getVar('SRCREV')
if old_srcrev == 'INVALID': if old_srcrev == 'INVALID':
old_srcrev = None old_srcrev = None
if old_srcrev and not args.srcrev: if old_srcrev and not args.srcrev:
raise DevtoolError("Recipe specifies a SRCREV value; you must specify a new one when upgrading") raise DevtoolError("Recipe specifies a SRCREV value; you must specify a new one when upgrading")
if rd.getVar('PV', True) == args.version and old_srcrev == args.srcrev: if rd.getVar('PV') == args.version and old_srcrev == args.srcrev:
raise DevtoolError("Current and upgrade versions are the same version") raise DevtoolError("Current and upgrade versions are the same version")
rf = None rf = None

View File

@ -39,7 +39,7 @@ def edit_recipe(args, config, basepath, workspace):
rd = parse_recipe(config, tinfoil, args.recipename, True) rd = parse_recipe(config, tinfoil, args.recipename, True)
if not rd: if not rd:
return 1 return 1
recipefile = rd.getVar('FILE', True) recipefile = rd.getVar('FILE')
finally: finally:
tinfoil.shutdown() tinfoil.shutdown()
else: else:
@ -62,20 +62,20 @@ def configure_help(args, config, basepath, workspace):
rd = parse_recipe(config, tinfoil, args.recipename, appends=True, filter_workspace=False) rd = parse_recipe(config, tinfoil, args.recipename, appends=True, filter_workspace=False)
if not rd: if not rd:
return 1 return 1
b = rd.getVar('B', True) b = rd.getVar('B')
s = rd.getVar('S', True) s = rd.getVar('S')
configurescript = os.path.join(s, 'configure') configurescript = os.path.join(s, 'configure')
confdisabled = 'noexec' in rd.getVarFlags('do_configure') or 'do_configure' not in (rd.getVar('__BBTASKS', False) or []) confdisabled = 'noexec' in rd.getVarFlags('do_configure') or 'do_configure' not in (rd.getVar('__BBTASKS', False) or [])
configureopts = oe.utils.squashspaces(rd.getVar('CONFIGUREOPTS', True) or '') configureopts = oe.utils.squashspaces(rd.getVar('CONFIGUREOPTS') or '')
extra_oeconf = oe.utils.squashspaces(rd.getVar('EXTRA_OECONF', True) or '') extra_oeconf = oe.utils.squashspaces(rd.getVar('EXTRA_OECONF') or '')
extra_oecmake = oe.utils.squashspaces(rd.getVar('EXTRA_OECMAKE', True) or '') extra_oecmake = oe.utils.squashspaces(rd.getVar('EXTRA_OECMAKE') or '')
do_configure = rd.getVar('do_configure', True) or '' do_configure = rd.getVar('do_configure') or ''
do_configure_noexpand = rd.getVar('do_configure', False) or '' do_configure_noexpand = rd.getVar('do_configure', False) or ''
packageconfig = rd.getVarFlags('PACKAGECONFIG') or [] packageconfig = rd.getVarFlags('PACKAGECONFIG') or []
autotools = bb.data.inherits_class('autotools', rd) and ('oe_runconf' in do_configure or 'autotools_do_configure' in do_configure) autotools = bb.data.inherits_class('autotools', rd) and ('oe_runconf' in do_configure or 'autotools_do_configure' in do_configure)
cmake = bb.data.inherits_class('cmake', rd) and ('cmake_do_configure' in do_configure) cmake = bb.data.inherits_class('cmake', rd) and ('cmake_do_configure' in do_configure)
cmake_do_configure = rd.getVar('cmake_do_configure', True) cmake_do_configure = rd.getVar('cmake_do_configure')
pn = rd.getVar('PN', True) pn = rd.getVar('PN')
finally: finally:
tinfoil.shutdown() tinfoil.shutdown()

View File

@ -48,7 +48,7 @@ def find_target_file(targetpath, d, pkglist=None):
"""Find the recipe installing the specified target path, optionally limited to a select list of packages""" """Find the recipe installing the specified target path, optionally limited to a select list of packages"""
import json import json
pkgdata_dir = d.getVar('PKGDATA_DIR', True) pkgdata_dir = d.getVar('PKGDATA_DIR')
# The mix between /etc and ${sysconfdir} here may look odd, but it is just # The mix between /etc and ${sysconfdir} here may look odd, but it is just
# being consistent with usage elsewhere # being consistent with usage elsewhere
@ -110,8 +110,8 @@ def determine_file_source(targetpath, rd):
import oe.recipeutils import oe.recipeutils
# See if it's in do_install for the recipe # See if it's in do_install for the recipe
workdir = rd.getVar('WORKDIR', True) workdir = rd.getVar('WORKDIR')
src_uri = rd.getVar('SRC_URI', True) src_uri = rd.getVar('SRC_URI')
srcfile = '' srcfile = ''
modpatches = [] modpatches = []
elements = check_do_install(rd, targetpath) elements = check_do_install(rd, targetpath)
@ -190,7 +190,7 @@ def get_source_path(cmdelements):
def get_func_deps(func, d): def get_func_deps(func, d):
"""Find the function dependencies of a shell function""" """Find the function dependencies of a shell function"""
deps = bb.codeparser.ShellParser(func, logger).parse_shell(d.getVar(func, True)) deps = bb.codeparser.ShellParser(func, logger).parse_shell(d.getVar(func))
deps |= set((d.getVarFlag(func, "vardeps", True) or "").split()) deps |= set((d.getVarFlag(func, "vardeps", True) or "").split())
funcdeps = [] funcdeps = []
for dep in deps: for dep in deps:
@ -200,12 +200,12 @@ def get_func_deps(func, d):
def check_do_install(rd, targetpath): def check_do_install(rd, targetpath):
"""Look at do_install for a command that installs/copies the specified target path""" """Look at do_install for a command that installs/copies the specified target path"""
instpath = os.path.abspath(os.path.join(rd.getVar('D', True), targetpath.lstrip('/'))) instpath = os.path.abspath(os.path.join(rd.getVar('D'), targetpath.lstrip('/')))
do_install = rd.getVar('do_install', True) do_install = rd.getVar('do_install')
# Handle where do_install calls other functions (somewhat crudely, but good enough for this purpose) # Handle where do_install calls other functions (somewhat crudely, but good enough for this purpose)
deps = get_func_deps('do_install', rd) deps = get_func_deps('do_install', rd)
for dep in deps: for dep in deps:
do_install = do_install.replace(dep, rd.getVar(dep, True)) do_install = do_install.replace(dep, rd.getVar(dep))
# Look backwards through do_install as we want to catch where a later line (perhaps # Look backwards through do_install as we want to catch where a later line (perhaps
# from a bbappend) is writing over the top # from a bbappend) is writing over the top
@ -322,12 +322,12 @@ def appendfile(args):
def appendsrc(args, files, rd, extralines=None): def appendsrc(args, files, rd, extralines=None):
import oe.recipeutils import oe.recipeutils
srcdir = rd.getVar('S', True) srcdir = rd.getVar('S')
workdir = rd.getVar('WORKDIR', True) workdir = rd.getVar('WORKDIR')
import bb.fetch import bb.fetch
simplified = {} simplified = {}
src_uri = rd.getVar('SRC_URI', True).split() src_uri = rd.getVar('SRC_URI').split()
for uri in src_uri: for uri in src_uri:
if uri.endswith(';'): if uri.endswith(';'):
uri = uri[:-1] uri = uri[:-1]
@ -340,7 +340,7 @@ def appendsrc(args, files, rd, extralines=None):
for newfile, srcfile in files.items(): 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') == rd.getVar('STAGING_KERNEL_DIR'):
srcdir = os.path.join(workdir, 'git') srcdir = os.path.join(workdir, 'git')
if not bb.data.inherits_class('kernel-yocto', rd): if not bb.data.inherits_class('kernel-yocto', rd):
logger.warn('S == STAGING_KERNEL_DIR and non-kernel-yocto, unable to determine path to srcdir, defaulting to ${WORKDIR}/git') logger.warn('S == STAGING_KERNEL_DIR and non-kernel-yocto, unable to determine path to srcdir, defaulting to ${WORKDIR}/git')

View File

@ -68,8 +68,8 @@ class RecipeHandler(object):
return return
# First build up library->package mapping # First build up library->package mapping
shlib_providers = oe.package.read_shlib_providers(d) shlib_providers = oe.package.read_shlib_providers(d)
libdir = d.getVar('libdir', True) libdir = d.getVar('libdir')
base_libdir = d.getVar('base_libdir', True) base_libdir = d.getVar('base_libdir')
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 = {}
@ -85,7 +85,7 @@ class RecipeHandler(object):
logger.debug('unable to extract library name from %s' % lib) logger.debug('unable to extract library name from %s' % lib)
# 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')
for libname, pkg in pkglibmap.items(): 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:
@ -109,9 +109,9 @@ class RecipeHandler(object):
'''Build up development file->recipe mapping''' '''Build up development file->recipe mapping'''
if RecipeHandler.recipeheadermap: if RecipeHandler.recipeheadermap:
return return
pkgdata_dir = d.getVar('PKGDATA_DIR', True) pkgdata_dir = d.getVar('PKGDATA_DIR')
includedir = d.getVar('includedir', True) includedir = d.getVar('includedir')
cmakedir = os.path.join(d.getVar('libdir', True), 'cmake') cmakedir = os.path.join(d.getVar('libdir'), 'cmake')
for pkg in glob.glob(os.path.join(pkgdata_dir, 'runtime', '*-dev')): for pkg in glob.glob(os.path.join(pkgdata_dir, 'runtime', '*-dev')):
with open(os.path.join(pkgdata_dir, 'runtime', pkg)) as f: with open(os.path.join(pkgdata_dir, 'runtime', pkg)) as f:
pn = None pn = None
@ -140,9 +140,9 @@ class RecipeHandler(object):
'''Build up native binary->recipe mapping''' '''Build up native binary->recipe mapping'''
if RecipeHandler.recipebinmap: if RecipeHandler.recipebinmap:
return return
sstate_manifests = d.getVar('SSTATE_MANIFESTS', True) sstate_manifests = d.getVar('SSTATE_MANIFESTS')
staging_bindir_native = d.getVar('STAGING_BINDIR_NATIVE', True) staging_bindir_native = d.getVar('STAGING_BINDIR_NATIVE')
build_arch = d.getVar('BUILD_ARCH', True) build_arch = d.getVar('BUILD_ARCH')
fileprefix = 'manifest-%s-' % build_arch fileprefix = 'manifest-%s-' % build_arch
for fn in glob.glob(os.path.join(sstate_manifests, '%s*-native.populate_sysroot' % fileprefix)): for fn in glob.glob(os.path.join(sstate_manifests, '%s*-native.populate_sysroot' % fileprefix)):
with open(fn, 'r') as f: with open(fn, 'r') as f:
@ -837,7 +837,7 @@ def get_license_md5sums(d, static_only=False):
md5sums = {} md5sums = {}
if not static_only: if not static_only:
# Gather md5sums of license files in common license dir # Gather md5sums of license files in common license dir
commonlicdir = d.getVar('COMMON_LICENSE_DIR', True) commonlicdir = d.getVar('COMMON_LICENSE_DIR')
for fn in os.listdir(commonlicdir): for fn in os.listdir(commonlicdir):
md5value = bb.utils.md5_file(os.path.join(commonlicdir, fn)) md5value = bb.utils.md5_file(os.path.join(commonlicdir, fn))
md5sums[md5value] = fn md5sums[md5value] = fn
@ -1007,7 +1007,7 @@ def split_pkg_licenses(licvalues, packages, outlines, fallback_licenses=None, pn
return outlicenses return outlicenses
def read_pkgconfig_provides(d): def read_pkgconfig_provides(d):
pkgdatadir = d.getVar('PKGDATA_DIR', True) pkgdatadir = d.getVar('PKGDATA_DIR')
pkgmap = {} pkgmap = {}
for fn in glob.glob(os.path.join(pkgdatadir, 'shlibs2', '*.pclist')): for fn in glob.glob(os.path.join(pkgdatadir, 'shlibs2', '*.pclist')):
with open(fn, 'r') as f: with open(fn, 'r') as f:
@ -1117,7 +1117,7 @@ def convert_rpm_xml(xmlfile):
def check_npm(d, debugonly=False): def check_npm(d, debugonly=False):
if not os.path.exists(os.path.join(d.getVar('STAGING_BINDIR_NATIVE', True), 'npm')): if not os.path.exists(os.path.join(d.getVar('STAGING_BINDIR_NATIVE'), 'npm')):
log_error_cond('npm required to process specified source, but npm is not available - you need to build nodejs-native first', debugonly) log_error_cond('npm required to process specified source, but npm is not available - you need to build nodejs-native first', debugonly)
sys.exit(14) sys.exit(14)

View File

@ -532,11 +532,11 @@ class PythonRecipeHandler(RecipeHandler):
def parse_pkgdata_for_python_packages(self): def parse_pkgdata_for_python_packages(self):
suffixes = [t[0] for t in imp.get_suffixes()] suffixes = [t[0] for t in imp.get_suffixes()]
pkgdata_dir = tinfoil.config_data.getVar('PKGDATA_DIR', True) pkgdata_dir = tinfoil.config_data.getVar('PKGDATA_DIR')
ldata = tinfoil.config_data.createCopy() ldata = tinfoil.config_data.createCopy()
bb.parse.handle('classes/python-dir.bbclass', ldata, True) bb.parse.handle('classes/python-dir.bbclass', ldata, True)
python_sitedir = ldata.getVar('PYTHON_SITEPACKAGES_DIR', True) python_sitedir = ldata.getVar('PYTHON_SITEPACKAGES_DIR')
dynload_dir = os.path.join(os.path.dirname(python_sitedir), 'lib-dynload') dynload_dir = os.path.join(os.path.dirname(python_sitedir), 'lib-dynload')
python_dirs = [python_sitedir + os.sep, python_dirs = [python_sitedir + os.sep,

View File

@ -41,7 +41,7 @@ class KernelRecipeHandler(RecipeHandler):
handled.append('buildsystem') handled.append('buildsystem')
del lines_after[:] del lines_after[:]
del classes[:] del classes[:]
template = os.path.join(tinfoil.config_data.getVar('COREBASE', True), 'meta-skeleton', 'recipes-kernel', 'linux', 'linux-yocto-custom.bb') template = os.path.join(tinfoil.config_data.getVar('COREBASE'), 'meta-skeleton', 'recipes-kernel', 'linux', 'linux-yocto-custom.bb')
def handle_var(varname, origvalue, op, newlines): def handle_var(varname, origvalue, op, newlines):
if varname in ['SRCREV', 'SRCREV_machine']: if varname in ['SRCREV', 'SRCREV_machine']:
while newlines[-1].startswith('#'): while newlines[-1].startswith('#'):
@ -85,7 +85,7 @@ class KernelRecipeHandler(RecipeHandler):
elif varname == 'COMPATIBLE_MACHINE': elif varname == 'COMPATIBLE_MACHINE':
while newlines[-1].startswith('#'): while newlines[-1].startswith('#'):
del newlines[-1] del newlines[-1]
machine = tinfoil.config_data.getVar('MACHINE', True) machine = tinfoil.config_data.getVar('MACHINE')
return machine, op, 0, True return machine, op, 0, True
return origvalue, op, 0, True return origvalue, op, 0, True
with open(template, 'r') as f: with open(template, 'r') as f:

View File

@ -49,7 +49,7 @@ class NpmRecipeHandler(RecipeHandler):
def _shrinkwrap(self, srctree, localfilesdir, extravalues, lines_before): def _shrinkwrap(self, srctree, localfilesdir, extravalues, lines_before):
try: try:
runenv = dict(os.environ, PATH=tinfoil.config_data.getVar('PATH', True)) runenv = dict(os.environ, PATH=tinfoil.config_data.getVar('PATH'))
bb.process.run('npm shrinkwrap', cwd=srctree, stderr=subprocess.STDOUT, env=runenv, shell=True) bb.process.run('npm shrinkwrap', cwd=srctree, stderr=subprocess.STDOUT, env=runenv, shell=True)
except bb.process.ExecutionError as e: except bb.process.ExecutionError as e:
logger.warn('npm shrinkwrap failed:\n%s' % e.stdout) logger.warn('npm shrinkwrap failed:\n%s' % e.stdout)
@ -62,7 +62,7 @@ class NpmRecipeHandler(RecipeHandler):
lines_before.append('NPM_SHRINKWRAP := "${THISDIR}/${PN}/npm-shrinkwrap.json"') lines_before.append('NPM_SHRINKWRAP := "${THISDIR}/${PN}/npm-shrinkwrap.json"')
def _lockdown(self, srctree, localfilesdir, extravalues, lines_before): def _lockdown(self, srctree, localfilesdir, extravalues, lines_before):
runenv = dict(os.environ, PATH=tinfoil.config_data.getVar('PATH', True)) runenv = dict(os.environ, PATH=tinfoil.config_data.getVar('PATH'))
if not NpmRecipeHandler.lockdownpath: if not NpmRecipeHandler.lockdownpath:
NpmRecipeHandler.lockdownpath = tempfile.mkdtemp('recipetool-npm-lockdown') NpmRecipeHandler.lockdownpath = tempfile.mkdtemp('recipetool-npm-lockdown')
bb.process.run('npm install lockdown --prefix %s' % NpmRecipeHandler.lockdownpath, bb.process.run('npm install lockdown --prefix %s' % NpmRecipeHandler.lockdownpath,
@ -257,7 +257,7 @@ class NpmRecipeHandler(RecipeHandler):
if version != '*' and not '/' in version: if version != '*' and not '/' in version:
pkgfullname += "@'%s'" % version pkgfullname += "@'%s'" % version
logger.debug(2, "Calling getdeps on %s" % pkg) logger.debug(2, "Calling getdeps on %s" % pkg)
runenv = dict(os.environ, PATH=d.getVar('PATH', True)) runenv = dict(os.environ, PATH=d.getVar('PATH'))
fetchcmd = "npm view %s --json" % pkgfullname fetchcmd = "npm view %s --json" % pkgfullname
output, _ = bb.process.run(fetchcmd, stderr=subprocess.STDOUT, env=runenv, shell=True) output, _ = bb.process.run(fetchcmd, stderr=subprocess.STDOUT, env=runenv, shell=True)
data = self._parse_view(output) data = self._parse_view(output)

View File

@ -60,7 +60,7 @@ def newappend(args):
if not path_ok: if not path_ok:
logger.warn('Unable to determine correct subdirectory path for bbappend file - check that what %s adds to BBFILES also matches .bbappend files. Using %s for now, but until you fix this the bbappend will not be applied.', os.path.join(args.destlayer, 'conf', 'layer.conf'), os.path.dirname(append_path)) logger.warn('Unable to determine correct subdirectory path for bbappend file - check that what %s adds to BBFILES also matches .bbappend files. Using %s for now, but until you fix this the bbappend will not be applied.', os.path.join(args.destlayer, 'conf', 'layer.conf'), os.path.dirname(append_path))
layerdirs = [os.path.abspath(layerdir) for layerdir in rd.getVar('BBLAYERS', True).split()] layerdirs = [os.path.abspath(layerdir) for layerdir in rd.getVar('BBLAYERS').split()]
if not os.path.abspath(args.destlayer) in layerdirs: if not os.path.abspath(args.destlayer) in layerdirs:
logger.warn('Specified layer is not currently enabled in bblayers.conf, you will need to add it before this bbappend will be active') logger.warn('Specified layer is not currently enabled in bblayers.conf, you will need to add it before this bbappend will be active')

View File

@ -93,7 +93,7 @@ def fetch_uri(d, uri, destdir, srcrev=None):
fetcher.download() fetcher.download()
for u in fetcher.ud: for u in fetcher.ud:
ud = fetcher.ud[u] ud = fetcher.ud[u]
if ud.localpath.rstrip(os.sep) == localdata.getVar('DL_DIR', True).rstrip(os.sep): if ud.localpath.rstrip(os.sep) == localdata.getVar('DL_DIR').rstrip(os.sep):
raise Exception('Local path is download directory - please check that the URI "%s" is correct' % uri) raise Exception('Local path is download directory - please check that the URI "%s" is correct' % uri)
fetcher.unpack(destdir) fetcher.unpack(destdir)
for u in fetcher.ud: for u in fetcher.ud:

View File

@ -570,7 +570,7 @@ def main():
logger.debug('Found bitbake path: %s' % bitbakepath) logger.debug('Found bitbake path: %s' % bitbakepath)
tinfoil = tinfoil_init() tinfoil = tinfoil_init()
try: try:
args.pkgdata_dir = tinfoil.config_data.getVar('PKGDATA_DIR', True) args.pkgdata_dir = tinfoil.config_data.getVar('PKGDATA_DIR')
finally: finally:
tinfoil.shutdown() tinfoil.shutdown()
logger.debug('Value of PKGDATA_DIR is "%s"' % args.pkgdata_dir) logger.debug('Value of PKGDATA_DIR is "%s"' % args.pkgdata_dir)

View File

@ -79,7 +79,7 @@ def main():
tinfoil = tinfoil_init(False) tinfoil = tinfoil_init(False)
try: try:
for path in (tinfoil.config_data.getVar('BBPATH', True).split(':') for path in (tinfoil.config_data.getVar('BBPATH').split(':')
+ [scripts_path]): + [scripts_path]):
pluginpath = os.path.join(path, 'lib', 'recipetool') pluginpath = os.path.join(path, 'lib', 'recipetool')
scriptutils.load_plugins(logger, plugins, pluginpath) scriptutils.load_plugins(logger, plugins, pluginpath)