From 69b69193411849de71cf7c81735c3239e28a2940 Mon Sep 17 00:00:00 2001 From: Richard Purdie Date: Thu, 18 Jun 2015 15:14:19 +0100 Subject: bitbake: bitbake: Add explict getVar param for (non) expansion Rather than just use d.getVar(X), use the more explict d.getVar(X, False) since at some point in the future, having the default of expansion would be nice. This is the first step towards that. This patch was mostly made using the command: sed -e 's:\(getVar([^,()]*\)\s*):\1, False):g' -i `grep -ril getVar *` (Bitbake rev: 659ef95c9b8aced3c4ded81c48bcc0fbde4d429f) Signed-off-by: Richard Purdie --- bitbake/lib/bb/cooker.py | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) (limited to 'bitbake/lib/bb/cooker.py') diff --git a/bitbake/lib/bb/cooker.py b/bitbake/lib/bb/cooker.py index d2b5ceb3bd..cf65ab2c96 100644 --- a/bitbake/lib/bb/cooker.py +++ b/bitbake/lib/bb/cooker.py @@ -386,7 +386,7 @@ class BBCooker: replaced = False #do not save if nothing changed - if str(val) == self.data.getVar(var): + if str(val) == self.data.getVar(var, False): return conf_files = self.data.varhistory.get_variable_files(var) @@ -398,7 +398,7 @@ class BBCooker: listval += "%s " % value val = listval - topdir = self.data.getVar("TOPDIR") + topdir = self.data.getVar("TOPDIR", False) #comment or replace operations made on var for conf_file in conf_files: @@ -453,7 +453,7 @@ class BBCooker: def removeConfigurationVar(self, var): conf_files = self.data.varhistory.get_variable_files(var) - topdir = self.data.getVar("TOPDIR") + topdir = self.data.getVar("TOPDIR", False) for conf_file in conf_files: if topdir in conf_file: @@ -493,7 +493,7 @@ class BBCooker: def parseConfiguration(self): # Set log file verbosity - verboselogs = bb.utils.to_boolean(self.data.getVar("BB_VERBOSE_LOGS", "0")) + verboselogs = bb.utils.to_boolean(self.data.getVar("BB_VERBOSE_LOGS", False)) if verboselogs: bb.msg.loggerVerboseLogs = True @@ -613,7 +613,7 @@ class BBCooker: data.expandKeys(envdata) for e in envdata.keys(): if data.getVarFlag( e, 'python', envdata ): - logger.plain("\npython %s () {\n%s}\n", e, data.getVar(e, envdata, 1)) + logger.plain("\npython %s () {\n%s}\n", e, envdata.getVar(e, True)) def buildTaskData(self, pkgs_to_build, task, abort): @@ -908,8 +908,8 @@ class BBCooker: for appends in appends_without_recipes for append in appends) msg = 'No recipes available for:\n%s' % '\n'.join(appendlines) - warn_only = data.getVar("BB_DANGLINGAPPENDS_WARNONLY", \ - self.data, False) or "no" + warn_only = self.data.getVar("BB_DANGLINGAPPENDS_WARNONLY", \ + False) or "no" if warn_only.lower() in ("1", "yes", "true"): bb.warn(msg) else: @@ -956,8 +956,8 @@ class BBCooker: # Generate a list of parsed configuration files by searching the files # listed in the __depends and __base_depends variables with a .conf suffix. conffiles = [] - dep_files = self.data.getVar('__base_depends') or [] - dep_files = dep_files + (self.data.getVar('__depends') or []) + dep_files = self.data.getVar('__base_depends', False) or [] + dep_files = dep_files + (self.data.getVar('__depends', False) or []) for f in dep_files: if f[0].endswith(".conf"): @@ -1174,7 +1174,7 @@ class BBCooker: """ Setup any variables needed before starting a build """ - if not self.data.getVar("BUILDNAME"): + if not self.data.getVar("BUILDNAME", False): self.data.setVar("BUILDNAME", time.strftime('%Y%m%d%H%M')) self.data.setVar("BUILDSTART", time.strftime('%m/%d/%Y %H:%M:%S', time.gmtime())) @@ -1275,7 +1275,7 @@ class BBCooker: taskdata = bb.taskdata.TaskData(self.configuration.abort) taskdata.add_provider(self.data, self.recipecache, item) - buildname = self.data.getVar("BUILDNAME") + buildname = self.data.getVar("BUILDNAME", False) bb.event.fire(bb.event.BuildStarted(buildname, [item]), self.expanded_data) # Execute the runqueue @@ -1348,7 +1348,7 @@ class BBCooker: taskdata, runlist, fulltargetlist = self.buildTaskData(targets, task, self.configuration.abort) - buildname = self.data.getVar("BUILDNAME") + buildname = self.data.getVar("BUILDNAME", False) bb.event.fire(bb.event.BuildStarted(buildname, fulltargetlist), self.data) rq = bb.runqueue.RunQueue(self, self.data, self.recipecache, taskdata, runlist) @@ -1402,7 +1402,7 @@ class BBCooker: if base_image is None: imagefile.write("inherit core-image\n") else: - topdir = self.data.getVar("TOPDIR") + topdir = self.data.getVar("TOPDIR", False) if topdir in base_image: base_image = require_line.split()[1] imagefile.write("require " + base_image + "\n") @@ -1462,7 +1462,7 @@ class BBCooker: (filelist, masked) = self.collection.collect_bbfiles(self.data, self.expanded_data) self.data.renameVar("__depends", "__base_depends") - self.add_filewatch(self.data.getVar("__base_depends"), self.configwatcher) + self.add_filewatch(self.data.getVar("__base_depends", False), self.configwatcher) self.parser = CookerParser(self, filelist, masked) self.parsecache_valid = True -- cgit v1.2.3-54-g00ecf