summaryrefslogtreecommitdiffstats
path: root/bitbake/lib/bb/cooker.py
diff options
context:
space:
mode:
authorRichard Purdie <richard.purdie@linuxfoundation.org>2015-06-18 15:14:19 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2015-06-23 11:57:53 +0100
commit69b69193411849de71cf7c81735c3239e28a2940 (patch)
tree054081264a49c9aa3002bc358ab0c4d7b7239015 /bitbake/lib/bb/cooker.py
parent86d30d756a60d181a95cf07041920a367a0cd0ba (diff)
downloadpoky-69b69193411849de71cf7c81735c3239e28a2940.tar.gz
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 <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/lib/bb/cooker.py')
-rw-r--r--bitbake/lib/bb/cooker.py28
1 files changed, 14 insertions, 14 deletions
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:
386 386
387 replaced = False 387 replaced = False
388 #do not save if nothing changed 388 #do not save if nothing changed
389 if str(val) == self.data.getVar(var): 389 if str(val) == self.data.getVar(var, False):
390 return 390 return
391 391
392 conf_files = self.data.varhistory.get_variable_files(var) 392 conf_files = self.data.varhistory.get_variable_files(var)
@@ -398,7 +398,7 @@ class BBCooker:
398 listval += "%s " % value 398 listval += "%s " % value
399 val = listval 399 val = listval
400 400
401 topdir = self.data.getVar("TOPDIR") 401 topdir = self.data.getVar("TOPDIR", False)
402 402
403 #comment or replace operations made on var 403 #comment or replace operations made on var
404 for conf_file in conf_files: 404 for conf_file in conf_files:
@@ -453,7 +453,7 @@ class BBCooker:
453 453
454 def removeConfigurationVar(self, var): 454 def removeConfigurationVar(self, var):
455 conf_files = self.data.varhistory.get_variable_files(var) 455 conf_files = self.data.varhistory.get_variable_files(var)
456 topdir = self.data.getVar("TOPDIR") 456 topdir = self.data.getVar("TOPDIR", False)
457 457
458 for conf_file in conf_files: 458 for conf_file in conf_files:
459 if topdir in conf_file: 459 if topdir in conf_file:
@@ -493,7 +493,7 @@ class BBCooker:
493 493
494 def parseConfiguration(self): 494 def parseConfiguration(self):
495 # Set log file verbosity 495 # Set log file verbosity
496 verboselogs = bb.utils.to_boolean(self.data.getVar("BB_VERBOSE_LOGS", "0")) 496 verboselogs = bb.utils.to_boolean(self.data.getVar("BB_VERBOSE_LOGS", False))
497 if verboselogs: 497 if verboselogs:
498 bb.msg.loggerVerboseLogs = True 498 bb.msg.loggerVerboseLogs = True
499 499
@@ -613,7 +613,7 @@ class BBCooker:
613 data.expandKeys(envdata) 613 data.expandKeys(envdata)
614 for e in envdata.keys(): 614 for e in envdata.keys():
615 if data.getVarFlag( e, 'python', envdata ): 615 if data.getVarFlag( e, 'python', envdata ):
616 logger.plain("\npython %s () {\n%s}\n", e, data.getVar(e, envdata, 1)) 616 logger.plain("\npython %s () {\n%s}\n", e, envdata.getVar(e, True))
617 617
618 618
619 def buildTaskData(self, pkgs_to_build, task, abort): 619 def buildTaskData(self, pkgs_to_build, task, abort):
@@ -908,8 +908,8 @@ class BBCooker:
908 for appends in appends_without_recipes 908 for appends in appends_without_recipes
909 for append in appends) 909 for append in appends)
910 msg = 'No recipes available for:\n%s' % '\n'.join(appendlines) 910 msg = 'No recipes available for:\n%s' % '\n'.join(appendlines)
911 warn_only = data.getVar("BB_DANGLINGAPPENDS_WARNONLY", \ 911 warn_only = self.data.getVar("BB_DANGLINGAPPENDS_WARNONLY", \
912 self.data, False) or "no" 912 False) or "no"
913 if warn_only.lower() in ("1", "yes", "true"): 913 if warn_only.lower() in ("1", "yes", "true"):
914 bb.warn(msg) 914 bb.warn(msg)
915 else: 915 else:
@@ -956,8 +956,8 @@ class BBCooker:
956 # Generate a list of parsed configuration files by searching the files 956 # Generate a list of parsed configuration files by searching the files
957 # listed in the __depends and __base_depends variables with a .conf suffix. 957 # listed in the __depends and __base_depends variables with a .conf suffix.
958 conffiles = [] 958 conffiles = []
959 dep_files = self.data.getVar('__base_depends') or [] 959 dep_files = self.data.getVar('__base_depends', False) or []
960 dep_files = dep_files + (self.data.getVar('__depends') or []) 960 dep_files = dep_files + (self.data.getVar('__depends', False) or [])
961 961
962 for f in dep_files: 962 for f in dep_files:
963 if f[0].endswith(".conf"): 963 if f[0].endswith(".conf"):
@@ -1174,7 +1174,7 @@ class BBCooker:
1174 """ 1174 """
1175 Setup any variables needed before starting a build 1175 Setup any variables needed before starting a build
1176 """ 1176 """
1177 if not self.data.getVar("BUILDNAME"): 1177 if not self.data.getVar("BUILDNAME", False):
1178 self.data.setVar("BUILDNAME", time.strftime('%Y%m%d%H%M')) 1178 self.data.setVar("BUILDNAME", time.strftime('%Y%m%d%H%M'))
1179 self.data.setVar("BUILDSTART", time.strftime('%m/%d/%Y %H:%M:%S', time.gmtime())) 1179 self.data.setVar("BUILDSTART", time.strftime('%m/%d/%Y %H:%M:%S', time.gmtime()))
1180 1180
@@ -1275,7 +1275,7 @@ class BBCooker:
1275 taskdata = bb.taskdata.TaskData(self.configuration.abort) 1275 taskdata = bb.taskdata.TaskData(self.configuration.abort)
1276 taskdata.add_provider(self.data, self.recipecache, item) 1276 taskdata.add_provider(self.data, self.recipecache, item)
1277 1277
1278 buildname = self.data.getVar("BUILDNAME") 1278 buildname = self.data.getVar("BUILDNAME", False)
1279 bb.event.fire(bb.event.BuildStarted(buildname, [item]), self.expanded_data) 1279 bb.event.fire(bb.event.BuildStarted(buildname, [item]), self.expanded_data)
1280 1280
1281 # Execute the runqueue 1281 # Execute the runqueue
@@ -1348,7 +1348,7 @@ class BBCooker:
1348 1348
1349 taskdata, runlist, fulltargetlist = self.buildTaskData(targets, task, self.configuration.abort) 1349 taskdata, runlist, fulltargetlist = self.buildTaskData(targets, task, self.configuration.abort)
1350 1350
1351 buildname = self.data.getVar("BUILDNAME") 1351 buildname = self.data.getVar("BUILDNAME", False)
1352 bb.event.fire(bb.event.BuildStarted(buildname, fulltargetlist), self.data) 1352 bb.event.fire(bb.event.BuildStarted(buildname, fulltargetlist), self.data)
1353 1353
1354 rq = bb.runqueue.RunQueue(self, self.data, self.recipecache, taskdata, runlist) 1354 rq = bb.runqueue.RunQueue(self, self.data, self.recipecache, taskdata, runlist)
@@ -1402,7 +1402,7 @@ class BBCooker:
1402 if base_image is None: 1402 if base_image is None:
1403 imagefile.write("inherit core-image\n") 1403 imagefile.write("inherit core-image\n")
1404 else: 1404 else:
1405 topdir = self.data.getVar("TOPDIR") 1405 topdir = self.data.getVar("TOPDIR", False)
1406 if topdir in base_image: 1406 if topdir in base_image:
1407 base_image = require_line.split()[1] 1407 base_image = require_line.split()[1]
1408 imagefile.write("require " + base_image + "\n") 1408 imagefile.write("require " + base_image + "\n")
@@ -1462,7 +1462,7 @@ class BBCooker:
1462 (filelist, masked) = self.collection.collect_bbfiles(self.data, self.expanded_data) 1462 (filelist, masked) = self.collection.collect_bbfiles(self.data, self.expanded_data)
1463 1463
1464 self.data.renameVar("__depends", "__base_depends") 1464 self.data.renameVar("__depends", "__base_depends")
1465 self.add_filewatch(self.data.getVar("__base_depends"), self.configwatcher) 1465 self.add_filewatch(self.data.getVar("__base_depends", False), self.configwatcher)
1466 1466
1467 self.parser = CookerParser(self, filelist, masked) 1467 self.parser = CookerParser(self, filelist, masked)
1468 self.parsecache_valid = True 1468 self.parsecache_valid = True