diff options
Diffstat (limited to 'bitbake/lib')
-rw-r--r-- | bitbake/lib/bb/command.py | 18 | ||||
-rw-r--r-- | bitbake/lib/bb/cooker.py | 146 | ||||
-rw-r--r-- | bitbake/lib/bb/runqueue.py | 12 |
3 files changed, 88 insertions, 88 deletions
diff --git a/bitbake/lib/bb/command.py b/bitbake/lib/bb/command.py index cc6a981921..ab6950111f 100644 --- a/bitbake/lib/bb/command.py +++ b/bitbake/lib/bb/command.py | |||
@@ -116,11 +116,11 @@ class Command: | |||
116 | 116 | ||
117 | def finishAsyncCommand(self, msg=None, code=None): | 117 | def finishAsyncCommand(self, msg=None, code=None): |
118 | if msg: | 118 | if msg: |
119 | bb.event.fire(CommandFailed(msg), self.cooker.configuration.event_data) | 119 | bb.event.fire(CommandFailed(msg), self.cooker.event_data) |
120 | elif code: | 120 | elif code: |
121 | bb.event.fire(CommandExit(code), self.cooker.configuration.event_data) | 121 | bb.event.fire(CommandExit(code), self.cooker.event_data) |
122 | else: | 122 | else: |
123 | bb.event.fire(CommandCompleted(), self.cooker.configuration.event_data) | 123 | bb.event.fire(CommandCompleted(), self.cooker.event_data) |
124 | self.currentAsyncCommand = None | 124 | self.currentAsyncCommand = None |
125 | 125 | ||
126 | 126 | ||
@@ -145,22 +145,22 @@ class CommandsSync: | |||
145 | 145 | ||
146 | def getVariable(self, command, params): | 146 | def getVariable(self, command, params): |
147 | """ | 147 | """ |
148 | Read the value of a variable from configuration.data | 148 | Read the value of a variable from data |
149 | """ | 149 | """ |
150 | varname = params[0] | 150 | varname = params[0] |
151 | expand = True | 151 | expand = True |
152 | if len(params) > 1: | 152 | if len(params) > 1: |
153 | expand = params[1] | 153 | expand = params[1] |
154 | 154 | ||
155 | return command.cooker.configuration.data.getVar(varname, expand) | 155 | return command.cooker.data.getVar(varname, expand) |
156 | 156 | ||
157 | def setVariable(self, command, params): | 157 | def setVariable(self, command, params): |
158 | """ | 158 | """ |
159 | Set the value of variable in configuration.data | 159 | Set the value of variable in data |
160 | """ | 160 | """ |
161 | varname = params[0] | 161 | varname = params[0] |
162 | value = str(params[1]) | 162 | value = str(params[1]) |
163 | command.cooker.configuration.data.setVar(varname, value) | 163 | command.cooker.data.setVar(varname, value) |
164 | 164 | ||
165 | def setConfig(self, command, params): | 165 | def setConfig(self, command, params): |
166 | """ | 166 | """ |
@@ -375,7 +375,7 @@ class CommandsAsync: | |||
375 | """ | 375 | """ |
376 | Parse the .bb files | 376 | Parse the .bb files |
377 | """ | 377 | """ |
378 | if bb.fetch.fetcher_compare_revisions(command.cooker.configuration.data): | 378 | if bb.fetch.fetcher_compare_revisions(command.cooker.data): |
379 | command.finishAsyncCommand(code=1) | 379 | command.finishAsyncCommand(code=1) |
380 | else: | 380 | else: |
381 | command.finishAsyncCommand() | 381 | command.finishAsyncCommand() |
@@ -398,7 +398,7 @@ class CommandsAsync: | |||
398 | Trigger a certain event | 398 | Trigger a certain event |
399 | """ | 399 | """ |
400 | event = params[0] | 400 | event = params[0] |
401 | bb.event.fire(eval(event), command.cooker.configuration.data) | 401 | bb.event.fire(eval(event), command.cooker.data) |
402 | command.currentAsyncCommand = None | 402 | command.currentAsyncCommand = None |
403 | triggerEvent.needcache = False | 403 | triggerEvent.needcache = False |
404 | 404 | ||
diff --git a/bitbake/lib/bb/cooker.py b/bitbake/lib/bb/cooker.py index 2edfa9faeb..77273dcb29 100644 --- a/bitbake/lib/bb/cooker.py +++ b/bitbake/lib/bb/cooker.py | |||
@@ -108,13 +108,13 @@ class BBCooker: | |||
108 | logger.critical("Unable to import extra RecipeInfo '%s' from '%s': %s" % (cache_name, module_name, exc)) | 108 | logger.critical("Unable to import extra RecipeInfo '%s' from '%s': %s" % (cache_name, module_name, exc)) |
109 | sys.exit("FATAL: Failed to import extra cache class '%s'." % cache_name) | 109 | sys.exit("FATAL: Failed to import extra cache class '%s'." % cache_name) |
110 | 110 | ||
111 | self.configuration.data = None | 111 | self.data = None |
112 | self.initConfigurationData() | 112 | self.initConfigurationData() |
113 | self.loadConfigurationData() | 113 | self.loadConfigurationData() |
114 | 114 | ||
115 | # Take a lock so only one copy of bitbake can run against a given build | 115 | # Take a lock so only one copy of bitbake can run against a given build |
116 | # directory at a time | 116 | # directory at a time |
117 | lockfile = self.configuration.data.expand("${TOPDIR}/bitbake.lock") | 117 | lockfile = self.data.expand("${TOPDIR}/bitbake.lock") |
118 | self.lock = bb.utils.lockfile(lockfile, False, False) | 118 | self.lock = bb.utils.lockfile(lockfile, False, False) |
119 | if not self.lock: | 119 | if not self.lock: |
120 | bb.fatal("Only one copy of bitbake should be run against a build directory") | 120 | bb.fatal("Only one copy of bitbake should be run against a build directory") |
@@ -122,9 +122,9 @@ class BBCooker: | |||
122 | # | 122 | # |
123 | # Special updated configuration we use for firing events | 123 | # Special updated configuration we use for firing events |
124 | # | 124 | # |
125 | self.configuration.event_data = bb.data.createCopy(self.configuration.data) | 125 | self.event_data = bb.data.createCopy(self.data) |
126 | bb.data.update_data(self.configuration.event_data) | 126 | bb.data.update_data(self.event_data) |
127 | bb.parse.init_parser(self.configuration.event_data) | 127 | bb.parse.init_parser(self.event_data) |
128 | 128 | ||
129 | # TOSTOP must not be set or our children will hang when they output | 129 | # TOSTOP must not be set or our children will hang when they output |
130 | fd = sys.stdout.fileno() | 130 | fd = sys.stdout.fileno() |
@@ -147,27 +147,27 @@ class BBCooker: | |||
147 | worker = True | 147 | worker = True |
148 | 148 | ||
149 | self.databuilder = bb.cookerdata.CookerDataBuilder(self.configuration, worker) | 149 | self.databuilder = bb.cookerdata.CookerDataBuilder(self.configuration, worker) |
150 | self.configuration.data = self.databuilder.data | 150 | self.data = self.databuilder.data |
151 | 151 | ||
152 | def enableDataTracking(self): | 152 | def enableDataTracking(self): |
153 | self.configuration.data.enableTracking() | 153 | self.data.enableTracking() |
154 | 154 | ||
155 | def disableDataTracking(self): | 155 | def disableDataTracking(self): |
156 | self.configuration.data.disableTracking() | 156 | self.data.disableTracking() |
157 | 157 | ||
158 | def loadConfigurationData(self): | 158 | def loadConfigurationData(self): |
159 | self.databuilder.parseBaseConfiguration() | 159 | self.databuilder.parseBaseConfiguration() |
160 | self.configuration.data = self.databuilder.data | 160 | self.data = self.databuilder.data |
161 | self.configuration.data_hash = self.databuilder.data_hash | 161 | self.data_hash = self.databuilder.data_hash |
162 | 162 | ||
163 | def saveConfigurationVar(self, var, val, default_file): | 163 | def saveConfigurationVar(self, var, val, default_file): |
164 | 164 | ||
165 | replaced = False | 165 | replaced = False |
166 | #do not save if nothing changed | 166 | #do not save if nothing changed |
167 | if str(val) == self.configuration.data.getVar(var): | 167 | if str(val) == self.data.getVar(var): |
168 | return | 168 | return |
169 | 169 | ||
170 | conf_files = self.configuration.data.varhistory.get_variable_files(var) | 170 | conf_files = self.data.varhistory.get_variable_files(var) |
171 | 171 | ||
172 | #format the value when it is a list | 172 | #format the value when it is a list |
173 | if isinstance(val, list): | 173 | if isinstance(val, list): |
@@ -176,7 +176,7 @@ class BBCooker: | |||
176 | listval += "%s " % value | 176 | listval += "%s " % value |
177 | val = listval | 177 | val = listval |
178 | 178 | ||
179 | topdir = self.configuration.data.getVar("TOPDIR") | 179 | topdir = self.data.getVar("TOPDIR") |
180 | 180 | ||
181 | #comment or replace operations made on var | 181 | #comment or replace operations made on var |
182 | for conf_file in conf_files: | 182 | for conf_file in conf_files: |
@@ -185,7 +185,7 @@ class BBCooker: | |||
185 | contents = f.readlines() | 185 | contents = f.readlines() |
186 | f.close() | 186 | f.close() |
187 | 187 | ||
188 | lines = self.configuration.data.varhistory.get_variable_lines(var, conf_file) | 188 | lines = self.data.varhistory.get_variable_lines(var, conf_file) |
189 | for line in lines: | 189 | for line in lines: |
190 | total = "" | 190 | total = "" |
191 | i = 0 | 191 | i = 0 |
@@ -218,7 +218,7 @@ class BBCooker: | |||
218 | 218 | ||
219 | if replaced == False: | 219 | if replaced == False: |
220 | #remove var from history | 220 | #remove var from history |
221 | self.configuration.data.varhistory.del_var_history(var) | 221 | self.data.varhistory.del_var_history(var) |
222 | 222 | ||
223 | #add var to the end of default_file | 223 | #add var to the end of default_file |
224 | default_file = bb.cookerdata.findConfigFile(default_file) | 224 | default_file = bb.cookerdata.findConfigFile(default_file) |
@@ -241,17 +241,17 @@ class BBCooker: | |||
241 | 241 | ||
242 | #add to history | 242 | #add to history |
243 | loginfo = {"op":set, "file":default_file, "line":total.count("\n")} | 243 | loginfo = {"op":set, "file":default_file, "line":total.count("\n")} |
244 | self.configuration.data.setVar(var, val, **loginfo) | 244 | self.data.setVar(var, val, **loginfo) |
245 | 245 | ||
246 | def parseConfiguration(self): | 246 | def parseConfiguration(self): |
247 | 247 | ||
248 | # Set log file verbosity | 248 | # Set log file verbosity |
249 | verboselogs = bb.utils.to_boolean(self.configuration.data.getVar("BB_VERBOSE_LOGS", "0")) | 249 | verboselogs = bb.utils.to_boolean(self.data.getVar("BB_VERBOSE_LOGS", "0")) |
250 | if verboselogs: | 250 | if verboselogs: |
251 | bb.msg.loggerVerboseLogs = True | 251 | bb.msg.loggerVerboseLogs = True |
252 | 252 | ||
253 | # Change nice level if we're asked to | 253 | # Change nice level if we're asked to |
254 | nice = self.configuration.data.getVar("BB_NICE_LEVEL", True) | 254 | nice = self.data.getVar("BB_NICE_LEVEL", True) |
255 | if nice: | 255 | if nice: |
256 | curnice = os.nice(0) | 256 | curnice = os.nice(0) |
257 | nice = int(nice) - curnice | 257 | nice = int(nice) - curnice |
@@ -261,7 +261,7 @@ class BBCooker: | |||
261 | del self.recipecache | 261 | del self.recipecache |
262 | self.recipecache = bb.cache.CacheData(self.caches_array) | 262 | self.recipecache = bb.cache.CacheData(self.caches_array) |
263 | 263 | ||
264 | self.handleCollections( self.configuration.data.getVar("BBFILE_COLLECTIONS", True) ) | 264 | self.handleCollections( self.data.getVar("BBFILE_COLLECTIONS", True) ) |
265 | 265 | ||
266 | def runCommands(self, server, data, abort): | 266 | def runCommands(self, server, data, abort): |
267 | """ | 267 | """ |
@@ -275,7 +275,7 @@ class BBCooker: | |||
275 | def showVersions(self): | 275 | def showVersions(self): |
276 | 276 | ||
277 | pkg_pn = self.recipecache.pkg_pn | 277 | pkg_pn = self.recipecache.pkg_pn |
278 | (latest_versions, preferred_versions) = bb.providers.findProviders(self.configuration.data, self.recipecache, pkg_pn) | 278 | (latest_versions, preferred_versions) = bb.providers.findProviders(self.data, self.recipecache, pkg_pn) |
279 | 279 | ||
280 | logger.plain("%-35s %25s %25s", "Recipe Name", "Latest Version", "Preferred Version") | 280 | logger.plain("%-35s %25s %25s", "Recipe Name", "Latest Version", "Preferred Version") |
281 | logger.plain("%-35s %25s %25s\n", "===========", "==============", "=================") | 281 | logger.plain("%-35s %25s %25s\n", "===========", "==============", "=================") |
@@ -308,11 +308,11 @@ class BBCooker: | |||
308 | fn = self.matchFile(fn) | 308 | fn = self.matchFile(fn) |
309 | fn = bb.cache.Cache.realfn2virtual(fn, cls) | 309 | fn = bb.cache.Cache.realfn2virtual(fn, cls) |
310 | elif len(pkgs_to_build) == 1: | 310 | elif len(pkgs_to_build) == 1: |
311 | ignore = self.configuration.data.getVar("ASSUME_PROVIDED", True) or "" | 311 | ignore = self.data.getVar("ASSUME_PROVIDED", True) or "" |
312 | if pkgs_to_build[0] in set(ignore.split()): | 312 | if pkgs_to_build[0] in set(ignore.split()): |
313 | bb.fatal("%s is in ASSUME_PROVIDED" % pkgs_to_build[0]) | 313 | bb.fatal("%s is in ASSUME_PROVIDED" % pkgs_to_build[0]) |
314 | 314 | ||
315 | localdata = data.createCopy(self.configuration.data) | 315 | localdata = data.createCopy(self.data) |
316 | bb.data.update_data(localdata) | 316 | bb.data.update_data(localdata) |
317 | bb.data.expandKeys(localdata) | 317 | bb.data.expandKeys(localdata) |
318 | 318 | ||
@@ -324,18 +324,18 @@ class BBCooker: | |||
324 | fnid = taskdata.build_targets[targetid][0] | 324 | fnid = taskdata.build_targets[targetid][0] |
325 | fn = taskdata.fn_index[fnid] | 325 | fn = taskdata.fn_index[fnid] |
326 | else: | 326 | else: |
327 | envdata = self.configuration.data | 327 | envdata = self.data |
328 | 328 | ||
329 | if fn: | 329 | if fn: |
330 | try: | 330 | try: |
331 | envdata = bb.cache.Cache.loadDataFull(fn, self.collection.get_file_appends(fn), self.configuration.data) | 331 | envdata = bb.cache.Cache.loadDataFull(fn, self.collection.get_file_appends(fn), self.data) |
332 | except Exception as e: | 332 | except Exception as e: |
333 | parselog.exception("Unable to read %s", fn) | 333 | parselog.exception("Unable to read %s", fn) |
334 | raise | 334 | raise |
335 | 335 | ||
336 | # Display history | 336 | # Display history |
337 | with closing(StringIO()) as env: | 337 | with closing(StringIO()) as env: |
338 | self.configuration.data.inchistory.emit(env) | 338 | self.data.inchistory.emit(env) |
339 | logger.plain(env.getvalue()) | 339 | logger.plain(env.getvalue()) |
340 | 340 | ||
341 | # emit variables and shell functions | 341 | # emit variables and shell functions |
@@ -354,7 +354,7 @@ class BBCooker: | |||
354 | """ | 354 | """ |
355 | Prepare a runqueue and taskdata object for iteration over pkgs_to_build | 355 | Prepare a runqueue and taskdata object for iteration over pkgs_to_build |
356 | """ | 356 | """ |
357 | bb.event.fire(bb.event.TreeDataPreparationStarted(), self.configuration.data) | 357 | bb.event.fire(bb.event.TreeDataPreparationStarted(), self.data) |
358 | 358 | ||
359 | # If we are told to do the None task then query the default task | 359 | # If we are told to do the None task then query the default task |
360 | if (task == None): | 360 | if (task == None): |
@@ -362,7 +362,7 @@ class BBCooker: | |||
362 | 362 | ||
363 | pkgs_to_build = self.checkPackages(pkgs_to_build) | 363 | pkgs_to_build = self.checkPackages(pkgs_to_build) |
364 | 364 | ||
365 | localdata = data.createCopy(self.configuration.data) | 365 | localdata = data.createCopy(self.data) |
366 | bb.data.update_data(localdata) | 366 | bb.data.update_data(localdata) |
367 | bb.data.expandKeys(localdata) | 367 | bb.data.expandKeys(localdata) |
368 | # We set abort to False here to prevent unbuildable targets raising | 368 | # We set abort to False here to prevent unbuildable targets raising |
@@ -375,9 +375,9 @@ class BBCooker: | |||
375 | taskdata.add_provider(localdata, self.recipecache, k) | 375 | taskdata.add_provider(localdata, self.recipecache, k) |
376 | runlist.append([k, "do_%s" % task]) | 376 | runlist.append([k, "do_%s" % task]) |
377 | current += 1 | 377 | current += 1 |
378 | bb.event.fire(bb.event.TreeDataPreparationProgress(current, len(pkgs_to_build)), self.configuration.data) | 378 | bb.event.fire(bb.event.TreeDataPreparationProgress(current, len(pkgs_to_build)), self.data) |
379 | taskdata.add_unresolved(localdata, self.recipecache) | 379 | taskdata.add_unresolved(localdata, self.recipecache) |
380 | bb.event.fire(bb.event.TreeDataPreparationCompleted(len(pkgs_to_build)), self.configuration.data) | 380 | bb.event.fire(bb.event.TreeDataPreparationCompleted(len(pkgs_to_build)), self.data) |
381 | return runlist, taskdata | 381 | return runlist, taskdata |
382 | 382 | ||
383 | ######## WARNING : this function requires cache_extra to be enabled ######## | 383 | ######## WARNING : this function requires cache_extra to be enabled ######## |
@@ -388,7 +388,7 @@ class BBCooker: | |||
388 | information. | 388 | information. |
389 | """ | 389 | """ |
390 | runlist, taskdata = self.prepareTreeData(pkgs_to_build, task) | 390 | runlist, taskdata = self.prepareTreeData(pkgs_to_build, task) |
391 | rq = bb.runqueue.RunQueue(self, self.configuration.data, self.recipecache, taskdata, runlist) | 391 | rq = bb.runqueue.RunQueue(self, self.data, self.recipecache, taskdata, runlist) |
392 | rq.rqdata.prepare() | 392 | rq.rqdata.prepare() |
393 | 393 | ||
394 | seen_fnids = [] | 394 | seen_fnids = [] |
@@ -543,7 +543,7 @@ class BBCooker: | |||
543 | Generate an event with the result | 543 | Generate an event with the result |
544 | """ | 544 | """ |
545 | depgraph = self.generateTaskDepTreeData(pkgs_to_build, task) | 545 | depgraph = self.generateTaskDepTreeData(pkgs_to_build, task) |
546 | bb.event.fire(bb.event.DepTreeGenerated(depgraph), self.configuration.data) | 546 | bb.event.fire(bb.event.DepTreeGenerated(depgraph), self.data) |
547 | 547 | ||
548 | def generateDotGraphFiles(self, pkgs_to_build, task): | 548 | def generateDotGraphFiles(self, pkgs_to_build, task): |
549 | """ | 549 | """ |
@@ -621,7 +621,7 @@ class BBCooker: | |||
621 | for append in appends) | 621 | for append in appends) |
622 | msg = 'No recipes available for:\n%s' % '\n'.join(appendlines) | 622 | msg = 'No recipes available for:\n%s' % '\n'.join(appendlines) |
623 | warn_only = data.getVar("BB_DANGLINGAPPENDS_WARNONLY", \ | 623 | warn_only = data.getVar("BB_DANGLINGAPPENDS_WARNONLY", \ |
624 | self.configuration.data, False) or "no" | 624 | self.data, False) or "no" |
625 | if warn_only.lower() in ("1", "yes", "true"): | 625 | if warn_only.lower() in ("1", "yes", "true"): |
626 | bb.warn(msg) | 626 | bb.warn(msg) |
627 | else: | 627 | else: |
@@ -629,7 +629,7 @@ class BBCooker: | |||
629 | 629 | ||
630 | def handlePrefProviders(self): | 630 | def handlePrefProviders(self): |
631 | 631 | ||
632 | localdata = data.createCopy(self.configuration.data) | 632 | localdata = data.createCopy(self.data) |
633 | bb.data.update_data(localdata) | 633 | bb.data.update_data(localdata) |
634 | bb.data.expandKeys(localdata) | 634 | bb.data.expandKeys(localdata) |
635 | 635 | ||
@@ -645,7 +645,7 @@ class BBCooker: | |||
645 | self.recipecache.preferred[providee] = provider | 645 | self.recipecache.preferred[providee] = provider |
646 | 646 | ||
647 | def findCoreBaseFiles(self, subdir, configfile): | 647 | def findCoreBaseFiles(self, subdir, configfile): |
648 | corebase = self.configuration.data.getVar('COREBASE', True) or "" | 648 | corebase = self.data.getVar('COREBASE', True) or "" |
649 | paths = [] | 649 | paths = [] |
650 | for root, dirs, files in os.walk(corebase + '/' + subdir): | 650 | for root, dirs, files in os.walk(corebase + '/' + subdir): |
651 | for d in dirs: | 651 | for d in dirs: |
@@ -654,7 +654,7 @@ class BBCooker: | |||
654 | paths.append(os.path.join(root, d)) | 654 | paths.append(os.path.join(root, d)) |
655 | 655 | ||
656 | if paths: | 656 | if paths: |
657 | bb.event.fire(bb.event.CoreBaseFilesFound(paths), self.configuration.data) | 657 | bb.event.fire(bb.event.CoreBaseFilesFound(paths), self.data) |
658 | 658 | ||
659 | def findConfigFilePath(self, configfile): | 659 | def findConfigFilePath(self, configfile): |
660 | """ | 660 | """ |
@@ -668,8 +668,8 @@ class BBCooker: | |||
668 | # Generate a list of parsed configuration files by searching the files | 668 | # Generate a list of parsed configuration files by searching the files |
669 | # listed in the __depends and __base_depends variables with a .conf suffix. | 669 | # listed in the __depends and __base_depends variables with a .conf suffix. |
670 | conffiles = [] | 670 | conffiles = [] |
671 | dep_files = self.configuration.data.getVar('__base_depends') or [] | 671 | dep_files = self.data.getVar('__base_depends') or [] |
672 | dep_files = dep_files + (self.configuration.data.getVar('__depends') or []) | 672 | dep_files = dep_files + (self.data.getVar('__depends') or []) |
673 | 673 | ||
674 | for f in dep_files: | 674 | for f in dep_files: |
675 | if f[0].endswith(".conf"): | 675 | if f[0].endswith(".conf"): |
@@ -682,7 +682,7 @@ class BBCooker: | |||
682 | for cfg in conffiles: | 682 | for cfg in conffiles: |
683 | if cfg.endswith(match): | 683 | if cfg.endswith(match): |
684 | bb.event.fire(bb.event.ConfigFilePathFound(path), | 684 | bb.event.fire(bb.event.ConfigFilePathFound(path), |
685 | self.configuration.data) | 685 | self.data) |
686 | break | 686 | break |
687 | 687 | ||
688 | def findFilesMatchingInDir(self, filepattern, directory): | 688 | def findFilesMatchingInDir(self, filepattern, directory): |
@@ -697,7 +697,7 @@ class BBCooker: | |||
697 | 697 | ||
698 | matches = [] | 698 | matches = [] |
699 | p = re.compile(re.escape(filepattern)) | 699 | p = re.compile(re.escape(filepattern)) |
700 | bbpaths = self.configuration.data.getVar('BBPATH', True).split(':') | 700 | bbpaths = self.data.getVar('BBPATH', True).split(':') |
701 | for path in bbpaths: | 701 | for path in bbpaths: |
702 | dirpath = os.path.join(path, directory) | 702 | dirpath = os.path.join(path, directory) |
703 | if os.path.exists(dirpath): | 703 | if os.path.exists(dirpath): |
@@ -707,7 +707,7 @@ class BBCooker: | |||
707 | matches.append(f) | 707 | matches.append(f) |
708 | 708 | ||
709 | if matches: | 709 | if matches: |
710 | bb.event.fire(bb.event.FilesMatchingFound(filepattern, matches), self.configuration.data) | 710 | bb.event.fire(bb.event.FilesMatchingFound(filepattern, matches), self.data) |
711 | 711 | ||
712 | def findConfigFiles(self, varname): | 712 | def findConfigFiles(self, varname): |
713 | """ | 713 | """ |
@@ -717,7 +717,7 @@ class BBCooker: | |||
717 | possible = [] | 717 | possible = [] |
718 | var = varname.lower() | 718 | var = varname.lower() |
719 | 719 | ||
720 | data = self.configuration.data | 720 | data = self.data |
721 | # iterate configs | 721 | # iterate configs |
722 | bbpaths = data.getVar('BBPATH', True).split(':') | 722 | bbpaths = data.getVar('BBPATH', True).split(':') |
723 | for path in bbpaths: | 723 | for path in bbpaths: |
@@ -731,7 +731,7 @@ class BBCooker: | |||
731 | possible.append(val) | 731 | possible.append(val) |
732 | 732 | ||
733 | if possible: | 733 | if possible: |
734 | bb.event.fire(bb.event.ConfigFilesFound(var, possible), self.configuration.data) | 734 | bb.event.fire(bb.event.ConfigFilesFound(var, possible), self.data) |
735 | 735 | ||
736 | def findInheritsClass(self, klass): | 736 | def findInheritsClass(self, klass): |
737 | """ | 737 | """ |
@@ -762,7 +762,7 @@ class BBCooker: | |||
762 | 762 | ||
763 | # generate a dependency tree for all our packages | 763 | # generate a dependency tree for all our packages |
764 | tree = self.generatePkgDepTreeData(pkgs, 'build') | 764 | tree = self.generatePkgDepTreeData(pkgs, 'build') |
765 | bb.event.fire(bb.event.TargetsTreeGenerated(tree), self.configuration.data) | 765 | bb.event.fire(bb.event.TargetsTreeGenerated(tree), self.data) |
766 | 766 | ||
767 | def buildWorldTargetList(self): | 767 | def buildWorldTargetList(self): |
768 | """ | 768 | """ |
@@ -808,7 +808,7 @@ class BBCooker: | |||
808 | min_prio = 0 | 808 | min_prio = 0 |
809 | for c in collection_list: | 809 | for c in collection_list: |
810 | # Get collection priority if defined explicitly | 810 | # Get collection priority if defined explicitly |
811 | priority = self.configuration.data.getVar("BBFILE_PRIORITY_%s" % c, True) | 811 | priority = self.data.getVar("BBFILE_PRIORITY_%s" % c, True) |
812 | if priority: | 812 | if priority: |
813 | try: | 813 | try: |
814 | prio = int(priority) | 814 | prio = int(priority) |
@@ -822,7 +822,7 @@ class BBCooker: | |||
822 | collection_priorities[c] = None | 822 | collection_priorities[c] = None |
823 | 823 | ||
824 | # Check dependencies and store information for priority calculation | 824 | # Check dependencies and store information for priority calculation |
825 | deps = self.configuration.data.getVar("LAYERDEPENDS_%s" % c, True) | 825 | deps = self.data.getVar("LAYERDEPENDS_%s" % c, True) |
826 | if deps: | 826 | if deps: |
827 | depnamelist = [] | 827 | depnamelist = [] |
828 | deplist = deps.split() | 828 | deplist = deps.split() |
@@ -842,7 +842,7 @@ class BBCooker: | |||
842 | 842 | ||
843 | if dep in collection_list: | 843 | if dep in collection_list: |
844 | if depver: | 844 | if depver: |
845 | layerver = self.configuration.data.getVar("LAYERVERSION_%s" % dep, True) | 845 | layerver = self.data.getVar("LAYERVERSION_%s" % dep, True) |
846 | if layerver: | 846 | if layerver: |
847 | try: | 847 | try: |
848 | lver = int(layerver) | 848 | lver = int(layerver) |
@@ -879,7 +879,7 @@ class BBCooker: | |||
879 | # Calculate all layer priorities using calc_layer_priority and store in bbfile_config_priorities | 879 | # Calculate all layer priorities using calc_layer_priority and store in bbfile_config_priorities |
880 | for c in collection_list: | 880 | for c in collection_list: |
881 | calc_layer_priority(c) | 881 | calc_layer_priority(c) |
882 | regex = self.configuration.data.getVar("BBFILE_PATTERN_%s" % c, True) | 882 | regex = self.data.getVar("BBFILE_PATTERN_%s" % c, True) |
883 | if regex == None: | 883 | if regex == None: |
884 | parselog.error("BBFILE_PATTERN_%s not defined" % c) | 884 | parselog.error("BBFILE_PATTERN_%s not defined" % c) |
885 | errors = True | 885 | errors = True |
@@ -899,9 +899,9 @@ class BBCooker: | |||
899 | """ | 899 | """ |
900 | Setup any variables needed before starting a build | 900 | Setup any variables needed before starting a build |
901 | """ | 901 | """ |
902 | if not self.configuration.data.getVar("BUILDNAME"): | 902 | if not self.data.getVar("BUILDNAME"): |
903 | self.configuration.data.setVar("BUILDNAME", time.strftime('%Y%m%d%H%M')) | 903 | self.data.setVar("BUILDNAME", time.strftime('%Y%m%d%H%M')) |
904 | self.configuration.data.setVar("BUILDSTART", time.strftime('%m/%d/%Y %H:%M:%S', time.gmtime())) | 904 | self.data.setVar("BUILDSTART", time.strftime('%m/%d/%Y %H:%M:%S', time.gmtime())) |
905 | 905 | ||
906 | def matchFiles(self, bf): | 906 | def matchFiles(self, bf): |
907 | """ | 907 | """ |
@@ -911,7 +911,7 @@ class BBCooker: | |||
911 | bf = os.path.abspath(bf) | 911 | bf = os.path.abspath(bf) |
912 | 912 | ||
913 | self.collection = CookerCollectFiles(self.recipecache.bbfile_config_priorities) | 913 | self.collection = CookerCollectFiles(self.recipecache.bbfile_config_priorities) |
914 | filelist, masked = self.collection.collect_bbfiles(self.configuration.data, self.configuration.event_data) | 914 | filelist, masked = self.collection.collect_bbfiles(self.data, self.event_data) |
915 | try: | 915 | try: |
916 | os.stat(bf) | 916 | os.stat(bf) |
917 | bf = os.path.abspath(bf) | 917 | bf = os.path.abspath(bf) |
@@ -966,7 +966,7 @@ class BBCooker: | |||
966 | 966 | ||
967 | self.recipecache = bb.cache.CacheData(self.caches_array) | 967 | self.recipecache = bb.cache.CacheData(self.caches_array) |
968 | infos = bb.cache.Cache.parse(fn, self.collection.get_file_appends(fn), \ | 968 | infos = bb.cache.Cache.parse(fn, self.collection.get_file_appends(fn), \ |
969 | self.configuration.data, | 969 | self.data, |
970 | self.caches_array) | 970 | self.caches_array) |
971 | infos = dict(infos) | 971 | infos = dict(infos) |
972 | 972 | ||
@@ -999,15 +999,15 @@ class BBCooker: | |||
999 | 999 | ||
1000 | # Setup taskdata structure | 1000 | # Setup taskdata structure |
1001 | taskdata = bb.taskdata.TaskData(self.configuration.abort) | 1001 | taskdata = bb.taskdata.TaskData(self.configuration.abort) |
1002 | taskdata.add_provider(self.configuration.data, self.recipecache, item) | 1002 | taskdata.add_provider(self.data, self.recipecache, item) |
1003 | 1003 | ||
1004 | buildname = self.configuration.data.getVar("BUILDNAME") | 1004 | buildname = self.data.getVar("BUILDNAME") |
1005 | bb.event.fire(bb.event.BuildStarted(buildname, [item]), self.configuration.event_data) | 1005 | bb.event.fire(bb.event.BuildStarted(buildname, [item]), self.event_data) |
1006 | 1006 | ||
1007 | # Execute the runqueue | 1007 | # Execute the runqueue |
1008 | runlist = [[item, "do_%s" % task]] | 1008 | runlist = [[item, "do_%s" % task]] |
1009 | 1009 | ||
1010 | rq = bb.runqueue.RunQueue(self, self.configuration.data, self.recipecache, taskdata, runlist) | 1010 | rq = bb.runqueue.RunQueue(self, self.data, self.recipecache, taskdata, runlist) |
1011 | 1011 | ||
1012 | def buildFileIdle(server, rq, abort): | 1012 | def buildFileIdle(server, rq, abort): |
1013 | 1013 | ||
@@ -1026,7 +1026,7 @@ class BBCooker: | |||
1026 | return False | 1026 | return False |
1027 | 1027 | ||
1028 | if not retval: | 1028 | if not retval: |
1029 | bb.event.fire(bb.event.BuildCompleted(len(rq.rqdata.runq_fnid), buildname, item, failures), self.configuration.event_data) | 1029 | bb.event.fire(bb.event.BuildCompleted(len(rq.rqdata.runq_fnid), buildname, item, failures), self.event_data) |
1030 | self.command.finishAsyncCommand() | 1030 | self.command.finishAsyncCommand() |
1031 | return False | 1031 | return False |
1032 | if retval is True: | 1032 | if retval is True: |
@@ -1063,7 +1063,7 @@ class BBCooker: | |||
1063 | return False | 1063 | return False |
1064 | 1064 | ||
1065 | if not retval: | 1065 | if not retval: |
1066 | bb.event.fire(bb.event.BuildCompleted(len(rq.rqdata.runq_fnid), buildname, targets, failures), self.configuration.data) | 1066 | bb.event.fire(bb.event.BuildCompleted(len(rq.rqdata.runq_fnid), buildname, targets, failures), self.data) |
1067 | self.command.finishAsyncCommand() | 1067 | self.command.finishAsyncCommand() |
1068 | return False | 1068 | return False |
1069 | if retval is True: | 1069 | if retval is True: |
@@ -1072,10 +1072,10 @@ class BBCooker: | |||
1072 | 1072 | ||
1073 | self.buildSetVars() | 1073 | self.buildSetVars() |
1074 | 1074 | ||
1075 | buildname = self.configuration.data.getVar("BUILDNAME") | 1075 | buildname = self.data.getVar("BUILDNAME") |
1076 | bb.event.fire(bb.event.BuildStarted(buildname, targets), self.configuration.data) | 1076 | bb.event.fire(bb.event.BuildStarted(buildname, targets), self.data) |
1077 | 1077 | ||
1078 | localdata = data.createCopy(self.configuration.data) | 1078 | localdata = data.createCopy(self.data) |
1079 | bb.data.update_data(localdata) | 1079 | bb.data.update_data(localdata) |
1080 | bb.data.expandKeys(localdata) | 1080 | bb.data.expandKeys(localdata) |
1081 | 1081 | ||
@@ -1087,7 +1087,7 @@ class BBCooker: | |||
1087 | runlist.append([k, "do_%s" % task]) | 1087 | runlist.append([k, "do_%s" % task]) |
1088 | taskdata.add_unresolved(localdata, self.recipecache) | 1088 | taskdata.add_unresolved(localdata, self.recipecache) |
1089 | 1089 | ||
1090 | rq = bb.runqueue.RunQueue(self, self.configuration.data, self.recipecache, taskdata, runlist) | 1090 | rq = bb.runqueue.RunQueue(self, self.data, self.recipecache, taskdata, runlist) |
1091 | if universe: | 1091 | if universe: |
1092 | rq.rqdata.warn_multi_bb = True | 1092 | rq.rqdata.warn_multi_bb = True |
1093 | 1093 | ||
@@ -1123,16 +1123,16 @@ class BBCooker: | |||
1123 | if self.state != state.parsing: | 1123 | if self.state != state.parsing: |
1124 | self.parseConfiguration () | 1124 | self.parseConfiguration () |
1125 | 1125 | ||
1126 | ignore = self.configuration.data.getVar("ASSUME_PROVIDED", True) or "" | 1126 | ignore = self.data.getVar("ASSUME_PROVIDED", True) or "" |
1127 | self.recipecache.ignored_dependencies = set(ignore.split()) | 1127 | self.recipecache.ignored_dependencies = set(ignore.split()) |
1128 | 1128 | ||
1129 | for dep in self.configuration.extra_assume_provided: | 1129 | for dep in self.configuration.extra_assume_provided: |
1130 | self.recipecache.ignored_dependencies.add(dep) | 1130 | self.recipecache.ignored_dependencies.add(dep) |
1131 | 1131 | ||
1132 | self.collection = CookerCollectFiles(self.recipecache.bbfile_config_priorities) | 1132 | self.collection = CookerCollectFiles(self.recipecache.bbfile_config_priorities) |
1133 | (filelist, masked) = self.collection.collect_bbfiles(self.configuration.data, self.configuration.event_data) | 1133 | (filelist, masked) = self.collection.collect_bbfiles(self.data, self.event_data) |
1134 | 1134 | ||
1135 | self.configuration.data.renameVar("__depends", "__base_depends") | 1135 | self.data.renameVar("__depends", "__base_depends") |
1136 | 1136 | ||
1137 | self.parser = CookerParser(self, filelist, masked) | 1137 | self.parser = CookerParser(self, filelist, masked) |
1138 | self.state = state.parsing | 1138 | self.state = state.parsing |
@@ -1177,14 +1177,14 @@ class BBCooker: | |||
1177 | # necessary from the data store. | 1177 | # necessary from the data store. |
1178 | #bb.utils.empty_environment() | 1178 | #bb.utils.empty_environment() |
1179 | try: | 1179 | try: |
1180 | prserv.serv.auto_start(self.configuration.data) | 1180 | prserv.serv.auto_start(self.data) |
1181 | except prserv.serv.PRServiceConfigError: | 1181 | except prserv.serv.PRServiceConfigError: |
1182 | bb.event.fire(CookerExit(), self.configuration.event_data) | 1182 | bb.event.fire(CookerExit(), self.event_data) |
1183 | return | 1183 | return |
1184 | 1184 | ||
1185 | def post_serve(self): | 1185 | def post_serve(self): |
1186 | prserv.serv.auto_shutdown(self.configuration.data) | 1186 | prserv.serv.auto_shutdown(self.data) |
1187 | bb.event.fire(CookerExit(), self.configuration.event_data) | 1187 | bb.event.fire(CookerExit(), self.event_data) |
1188 | 1188 | ||
1189 | def shutdown(self): | 1189 | def shutdown(self): |
1190 | self.state = state.shutdown | 1190 | self.state = state.shutdown |
@@ -1490,8 +1490,8 @@ class CookerParser(object): | |||
1490 | def __init__(self, cooker, filelist, masked): | 1490 | def __init__(self, cooker, filelist, masked): |
1491 | self.filelist = filelist | 1491 | self.filelist = filelist |
1492 | self.cooker = cooker | 1492 | self.cooker = cooker |
1493 | self.cfgdata = cooker.configuration.data | 1493 | self.cfgdata = cooker.data |
1494 | self.cfghash = cooker.configuration.data_hash | 1494 | self.cfghash = cooker.data_hash |
1495 | 1495 | ||
1496 | # Accounting statistics | 1496 | # Accounting statistics |
1497 | self.parsed = 0 | 1497 | self.parsed = 0 |
@@ -1582,8 +1582,8 @@ class CookerParser(object): | |||
1582 | sync = threading.Thread(target=self.bb_cache.sync) | 1582 | sync = threading.Thread(target=self.bb_cache.sync) |
1583 | sync.start() | 1583 | sync.start() |
1584 | multiprocessing.util.Finalize(None, sync.join, exitpriority=-100) | 1584 | multiprocessing.util.Finalize(None, sync.join, exitpriority=-100) |
1585 | bb.codeparser.parser_cache_savemerge(self.cooker.configuration.data) | 1585 | bb.codeparser.parser_cache_savemerge(self.cooker.data) |
1586 | bb.fetch.fetcher_parse_done(self.cooker.configuration.data) | 1586 | bb.fetch.fetcher_parse_done(self.cooker.data) |
1587 | 1587 | ||
1588 | def load_cached(self): | 1588 | def load_cached(self): |
1589 | for filename, appends in self.fromcache: | 1589 | for filename, appends in self.fromcache: |
diff --git a/bitbake/lib/bb/runqueue.py b/bitbake/lib/bb/runqueue.py index f1964da906..090d1b56a2 100644 --- a/bitbake/lib/bb/runqueue.py +++ b/bitbake/lib/bb/runqueue.py | |||
@@ -957,7 +957,7 @@ class RunQueue: | |||
957 | for task in range(len(self.rqdata.runq_fnid)): | 957 | for task in range(len(self.rqdata.runq_fnid)): |
958 | if self.rqdata.runq_fnid[task] not in done: | 958 | if self.rqdata.runq_fnid[task] not in done: |
959 | fn = self.rqdata.taskData.fn_index[self.rqdata.runq_fnid[task]] | 959 | fn = self.rqdata.taskData.fn_index[self.rqdata.runq_fnid[task]] |
960 | the_data = bb.cache.Cache.loadDataFull(fn, self.cooker.collection.get_file_appends(fn), self.cooker.configuration.data) | 960 | the_data = bb.cache.Cache.loadDataFull(fn, self.cooker.collection.get_file_appends(fn), self.cooker.data) |
961 | done.add(self.rqdata.runq_fnid[task]) | 961 | done.add(self.rqdata.runq_fnid[task]) |
962 | 962 | ||
963 | bb.parse.siggen.dump_sigs(self.rqdata.dataCache) | 963 | bb.parse.siggen.dump_sigs(self.rqdata.dataCache) |
@@ -1119,11 +1119,11 @@ class RunQueueExecute: | |||
1119 | if umask: | 1119 | if umask: |
1120 | os.umask(umask) | 1120 | os.umask(umask) |
1121 | 1121 | ||
1122 | self.cooker.configuration.data.setVar("BB_WORKERCONTEXT", "1") | 1122 | self.cooker.data.setVar("BB_WORKERCONTEXT", "1") |
1123 | bb.parse.siggen.set_taskdata(self.rqdata.hashes, self.rqdata.hash_deps) | 1123 | bb.parse.siggen.set_taskdata(self.rqdata.hashes, self.rqdata.hash_deps) |
1124 | ret = 0 | 1124 | ret = 0 |
1125 | try: | 1125 | try: |
1126 | the_data = bb.cache.Cache.loadDataFull(fn, self.cooker.collection.get_file_appends(fn), self.cooker.configuration.data) | 1126 | the_data = bb.cache.Cache.loadDataFull(fn, self.cooker.collection.get_file_appends(fn), self.cooker.data) |
1127 | the_data.setVar('BB_TASKHASH', self.rqdata.runq_hash[task]) | 1127 | the_data.setVar('BB_TASKHASH', self.rqdata.runq_hash[task]) |
1128 | for h in self.rqdata.hashes: | 1128 | for h in self.rqdata.hashes: |
1129 | the_data.setVar("BBHASH_%s" % h, self.rqdata.hashes[h]) | 1129 | the_data.setVar("BBHASH_%s" % h, self.rqdata.hashes[h]) |
@@ -1180,7 +1180,7 @@ class RunQueueExecute: | |||
1180 | taskname = self.rqdata.runq_task[depid] | 1180 | taskname = self.rqdata.runq_task[depid] |
1181 | taskdata[dep] = [pn, taskname, fn] | 1181 | taskdata[dep] = [pn, taskname, fn] |
1182 | call = self.rq.depvalidate + "(task, taskdata, notneeded, d)" | 1182 | call = self.rq.depvalidate + "(task, taskdata, notneeded, d)" |
1183 | locs = { "task" : task, "taskdata" : taskdata, "notneeded" : self.scenequeue_notneeded, "d" : self.cooker.configuration.data } | 1183 | locs = { "task" : task, "taskdata" : taskdata, "notneeded" : self.scenequeue_notneeded, "d" : self.cooker.data } |
1184 | valid = bb.utils.better_eval(call, locs) | 1184 | valid = bb.utils.better_eval(call, locs) |
1185 | return valid | 1185 | return valid |
1186 | 1186 | ||
@@ -1247,7 +1247,7 @@ class RunQueueExecuteTasks(RunQueueExecute): | |||
1247 | 1247 | ||
1248 | call = self.rq.setsceneverify + "(covered, tasknames, fnids, fns, d, invalidtasks=invalidtasks)" | 1248 | call = self.rq.setsceneverify + "(covered, tasknames, fnids, fns, d, invalidtasks=invalidtasks)" |
1249 | call2 = self.rq.setsceneverify + "(covered, tasknames, fnids, fns, d)" | 1249 | call2 = self.rq.setsceneverify + "(covered, tasknames, fnids, fns, d)" |
1250 | locs = { "covered" : self.rq.scenequeue_covered, "tasknames" : self.rqdata.runq_task, "fnids" : self.rqdata.runq_fnid, "fns" : self.rqdata.taskData.fn_index, "d" : self.cooker.configuration.data, "invalidtasks" : invalidtasks } | 1250 | locs = { "covered" : self.rq.scenequeue_covered, "tasknames" : self.rqdata.runq_task, "fnids" : self.rqdata.runq_fnid, "fns" : self.rqdata.taskData.fn_index, "d" : self.cooker.data, "invalidtasks" : invalidtasks } |
1251 | # Backwards compatibility with older versions without invalidtasks | 1251 | # Backwards compatibility with older versions without invalidtasks |
1252 | try: | 1252 | try: |
1253 | covered_remove = bb.utils.better_eval(call, locs) | 1253 | covered_remove = bb.utils.better_eval(call, locs) |
@@ -1607,7 +1607,7 @@ class RunQueueExecuteScenequeue(RunQueueExecute): | |||
1607 | sq_taskname.append(taskname) | 1607 | sq_taskname.append(taskname) |
1608 | sq_task.append(task) | 1608 | sq_task.append(task) |
1609 | call = self.rq.hashvalidate + "(sq_fn, sq_task, sq_hash, sq_hashfn, d)" | 1609 | call = self.rq.hashvalidate + "(sq_fn, sq_task, sq_hash, sq_hashfn, d)" |
1610 | locs = { "sq_fn" : sq_fn, "sq_task" : sq_taskname, "sq_hash" : sq_hash, "sq_hashfn" : sq_hashfn, "d" : self.cooker.configuration.data } | 1610 | locs = { "sq_fn" : sq_fn, "sq_task" : sq_taskname, "sq_hash" : sq_hash, "sq_hashfn" : sq_hashfn, "d" : self.cooker.data } |
1611 | valid = bb.utils.better_eval(call, locs) | 1611 | valid = bb.utils.better_eval(call, locs) |
1612 | 1612 | ||
1613 | valid_new = stamppresent | 1613 | valid_new = stamppresent |