mirror of
git://git.yoctoproject.org/poky.git
synced 2025-07-19 21:09:03 +02:00
meta/classes: Convert to use appendVar and appendVarFlags
(From OE-Core rev: 3b57de68e70e77dbc03c0616a83a29a2e99e40b4) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
parent
082cc604f5
commit
ff73b02a72
|
@ -70,9 +70,9 @@ class TaskBase(event.Event):
|
|||
|
||||
def __init__(self, t, d ):
|
||||
self._task = t
|
||||
self._package = d.getVar("PF", 1)
|
||||
self._package = d.getVar("PF", True)
|
||||
event.Event.__init__(self)
|
||||
self._message = "package %s: task %s: %s" % (d.getVar("PF", 1), t, self.getDisplayName())
|
||||
self._message = "package %s: task %s: %s" % (d.getVar("PF", True), t, self.getDisplayName())
|
||||
|
||||
def getTask(self):
|
||||
return self._task
|
||||
|
|
|
@ -298,7 +298,7 @@ class BBCooker:
|
|||
# this showEnvironment() code path doesn't use the cache
|
||||
self.parseConfiguration()
|
||||
self.status = bb.cache.CacheData(self.caches_array)
|
||||
self.handleCollections( self.configuration.data.getVar("BBFILE_COLLECTIONS", 1) )
|
||||
self.handleCollections( self.configuration.data.getVar("BBFILE_COLLECTIONS", True) )
|
||||
|
||||
fn, cls = bb.cache.Cache.virtualfn2realfn(buildfile)
|
||||
fn = self.matchFile(fn)
|
||||
|
@ -882,7 +882,7 @@ class BBCooker:
|
|||
min_prio = 0
|
||||
for c in collection_list:
|
||||
# Get collection priority if defined explicitly
|
||||
priority = self.configuration.data.getVar("BBFILE_PRIORITY_%s" % c, 1)
|
||||
priority = self.configuration.data.getVar("BBFILE_PRIORITY_%s" % c, True)
|
||||
if priority:
|
||||
try:
|
||||
prio = int(priority)
|
||||
|
@ -896,7 +896,7 @@ class BBCooker:
|
|||
collection_priorities[c] = None
|
||||
|
||||
# Check dependencies and store information for priority calculation
|
||||
deps = self.configuration.data.getVar("LAYERDEPENDS_%s" % c, 1)
|
||||
deps = self.configuration.data.getVar("LAYERDEPENDS_%s" % c, True)
|
||||
if deps:
|
||||
depnamelist = []
|
||||
deplist = deps.split()
|
||||
|
@ -916,7 +916,7 @@ class BBCooker:
|
|||
|
||||
if dep in collection_list:
|
||||
if depver:
|
||||
layerver = self.configuration.data.getVar("LAYERVERSION_%s" % dep, 1)
|
||||
layerver = self.configuration.data.getVar("LAYERVERSION_%s" % dep, True)
|
||||
if layerver:
|
||||
try:
|
||||
lver = int(layerver)
|
||||
|
@ -953,7 +953,7 @@ class BBCooker:
|
|||
# Calculate all layer priorities using calc_layer_priority and store in bbfile_config_priorities
|
||||
for c in collection_list:
|
||||
calc_layer_priority(c)
|
||||
regex = self.configuration.data.getVar("BBFILE_PATTERN_%s" % c, 1)
|
||||
regex = self.configuration.data.getVar("BBFILE_PATTERN_%s" % c, True)
|
||||
if regex == None:
|
||||
parselog.error("BBFILE_PATTERN_%s not defined" % c)
|
||||
errors = True
|
||||
|
@ -1027,7 +1027,7 @@ class BBCooker:
|
|||
# buildFile() doesn't use the cache
|
||||
self.parseConfiguration()
|
||||
self.status = bb.cache.CacheData(self.caches_array)
|
||||
self.handleCollections( self.configuration.data.getVar("BBFILE_COLLECTIONS", 1) )
|
||||
self.handleCollections( self.configuration.data.getVar("BBFILE_COLLECTIONS", True) )
|
||||
|
||||
# If we are told to do the None task then query the default task
|
||||
if (task == None):
|
||||
|
@ -1181,13 +1181,13 @@ class BBCooker:
|
|||
del self.status
|
||||
self.status = bb.cache.CacheData(self.caches_array)
|
||||
|
||||
ignore = self.configuration.data.getVar("ASSUME_PROVIDED", 1) or ""
|
||||
ignore = self.configuration.data.getVar("ASSUME_PROVIDED", True) or ""
|
||||
self.status.ignored_dependencies = set(ignore.split())
|
||||
|
||||
for dep in self.configuration.extra_assume_provided:
|
||||
self.status.ignored_dependencies.add(dep)
|
||||
|
||||
self.handleCollections( self.configuration.data.getVar("BBFILE_COLLECTIONS", 1) )
|
||||
self.handleCollections( self.configuration.data.getVar("BBFILE_COLLECTIONS", True) )
|
||||
|
||||
(filelist, masked) = self.collect_bbfiles()
|
||||
self.configuration.data.renameVar("__depends", "__base_depends")
|
||||
|
@ -1282,7 +1282,7 @@ class BBCooker:
|
|||
if g not in newfiles:
|
||||
newfiles.append(g)
|
||||
|
||||
bbmask = self.configuration.data.getVar('BBMASK', 1)
|
||||
bbmask = self.configuration.data.getVar('BBMASK', True)
|
||||
|
||||
if bbmask:
|
||||
try:
|
||||
|
|
|
@ -58,7 +58,7 @@ class VariableParse:
|
|||
if self.varname and key:
|
||||
if self.varname == key:
|
||||
raise Exception("variable %s references itself!" % self.varname)
|
||||
var = self.d.getVar(key, 1)
|
||||
var = self.d.getVar(key, True)
|
||||
if var is not None:
|
||||
self.references.add(key)
|
||||
return var
|
||||
|
|
|
@ -154,7 +154,7 @@ def fetcher_init(d):
|
|||
Calls before this must not hit the cache.
|
||||
"""
|
||||
# When to drop SCM head revisions controlled by user policy
|
||||
srcrev_policy = d.getVar('BB_SRCREV_POLICY', 1) or "clear"
|
||||
srcrev_policy = d.getVar('BB_SRCREV_POLICY', True) or "clear"
|
||||
if srcrev_policy == "cache":
|
||||
logger.debug(1, "Keeping SRCREV cache due to cache policy of: %s", srcrev_policy)
|
||||
elif srcrev_policy == "clear":
|
||||
|
@ -200,7 +200,7 @@ def fetcher_compare_revisions(d):
|
|||
def init(urls, d, setup = True):
|
||||
urldata = {}
|
||||
|
||||
fn = d.getVar('FILE', 1)
|
||||
fn = d.getVar('FILE', True)
|
||||
if fn in urldata_cache:
|
||||
urldata = urldata_cache[fn]
|
||||
|
||||
|
@ -261,7 +261,7 @@ def go(d, urls = None):
|
|||
init must have previously been called
|
||||
"""
|
||||
if not urls:
|
||||
urls = d.getVar("SRC_URI", 1).split()
|
||||
urls = d.getVar("SRC_URI", True).split()
|
||||
urldata = init(urls, d, True)
|
||||
|
||||
for u in urls:
|
||||
|
@ -383,7 +383,7 @@ def get_srcrev(d):
|
|||
scms = []
|
||||
|
||||
# Only call setup_localpath on URIs which supports_srcrev()
|
||||
urldata = init(d.getVar('SRC_URI', 1).split(), d, False)
|
||||
urldata = init(d.getVar('SRC_URI', True).split(), d, False)
|
||||
for u in urldata:
|
||||
ud = urldata[u]
|
||||
if ud.method.supports_srcrev():
|
||||
|
@ -404,7 +404,7 @@ def get_srcrev(d):
|
|||
#
|
||||
# Mutiple SCMs are in SRC_URI so we resort to SRCREV_FORMAT
|
||||
#
|
||||
format = d.getVar('SRCREV_FORMAT', 1)
|
||||
format = d.getVar('SRCREV_FORMAT', True)
|
||||
if not format:
|
||||
logger.error("The SRCREV_FORMAT variable must be set when multiple SCMs are used.")
|
||||
raise ParameterError
|
||||
|
|
|
@ -136,7 +136,7 @@ def getInterval(configuration):
|
|||
|
||||
""" Get the disk space interval """
|
||||
|
||||
interval = configuration.getVar("BB_DISKMON_WARNINTERVAL", 1)
|
||||
interval = configuration.getVar("BB_DISKMON_WARNINTERVAL", True)
|
||||
if not interval:
|
||||
# The default value is 50M and 5K.
|
||||
return 50 * 1024 * 1024, 5 * 1024
|
||||
|
@ -170,7 +170,7 @@ class diskMonitor:
|
|||
|
||||
self.enableMonitor = False
|
||||
|
||||
BBDirs = configuration.getVar("BB_DISKMON_DIRS", 1) or None
|
||||
BBDirs = configuration.getVar("BB_DISKMON_DIRS", True) or None
|
||||
if BBDirs:
|
||||
self.devDict = getDiskData(BBDirs, configuration)
|
||||
if self.devDict:
|
||||
|
|
|
@ -58,7 +58,7 @@ def include(oldfn, fn, lineno, data, error_out):
|
|||
|
||||
if not os.path.isabs(fn):
|
||||
dname = os.path.dirname(oldfn)
|
||||
bbpath = "%s:%s" % (dname, data.getVar("BBPATH", 1))
|
||||
bbpath = "%s:%s" % (dname, data.getVar("BBPATH", True))
|
||||
abs_fn = bb.utils.which(bbpath, fn)
|
||||
if abs_fn:
|
||||
fn = abs_fn
|
||||
|
|
|
@ -284,7 +284,7 @@ def filterProviders(providers, item, cfgData, dataCache):
|
|||
|
||||
eligible = _filterProviders(providers, item, cfgData, dataCache)
|
||||
|
||||
prefervar = cfgData.getVar('PREFERRED_PROVIDER_%s' % item, 1)
|
||||
prefervar = cfgData.getVar('PREFERRED_PROVIDER_%s' % item, True)
|
||||
if prefervar:
|
||||
dataCache.preferred[item] = prefervar
|
||||
|
||||
|
@ -322,7 +322,7 @@ def filterProvidersRunTime(providers, item, cfgData, dataCache):
|
|||
pn = dataCache.pkg_fn[p]
|
||||
provides = dataCache.pn_provides[pn]
|
||||
for provide in provides:
|
||||
prefervar = cfgData.getVar('PREFERRED_PROVIDER_%s' % provide, 1)
|
||||
prefervar = cfgData.getVar('PREFERRED_PROVIDER_%s' % provide, True)
|
||||
logger.debug(1, "checking PREFERRED_PROVIDER_%s (value %s) against %s", provide, prefervar, pns.keys())
|
||||
if prefervar in pns and pns[prefervar] not in preferred:
|
||||
var = "PREFERRED_PROVIDER_%s = %s" % (provide, prefervar)
|
||||
|
|
|
@ -190,8 +190,8 @@ class RunQueueData:
|
|||
self.rq = rq
|
||||
self.warn_multi_bb = False
|
||||
|
||||
self.stampwhitelist = cfgData.getVar("BB_STAMP_WHITELIST", 1) or ""
|
||||
self.multi_provider_whitelist = (cfgData.getVar("MULTI_PROVIDER_WHITELIST", 1) or "").split()
|
||||
self.stampwhitelist = cfgData.getVar("BB_STAMP_WHITELIST", True) or ""
|
||||
self.multi_provider_whitelist = (cfgData.getVar("MULTI_PROVIDER_WHITELIST", True) or "").split()
|
||||
|
||||
self.reset()
|
||||
|
||||
|
@ -1029,8 +1029,8 @@ class RunQueueExecute:
|
|||
self.cfgData = rq.cfgData
|
||||
self.rqdata = rq.rqdata
|
||||
|
||||
self.number_tasks = int(self.cfgData.getVar("BB_NUMBER_THREADS", 1) or 1)
|
||||
self.scheduler = self.cfgData.getVar("BB_SCHEDULER", 1) or "speed"
|
||||
self.number_tasks = int(self.cfgData.getVar("BB_NUMBER_THREADS", True) or 1)
|
||||
self.scheduler = self.cfgData.getVar("BB_SCHEDULER", True) or "speed"
|
||||
|
||||
self.runq_buildable = []
|
||||
self.runq_running = []
|
||||
|
|
Loading…
Reference in New Issue
Block a user