diff options
Diffstat (limited to 'bitbake/lib/bb/cooker.py')
| -rw-r--r-- | bitbake/lib/bb/cooker.py | 34 |
1 files changed, 25 insertions, 9 deletions
diff --git a/bitbake/lib/bb/cooker.py b/bitbake/lib/bb/cooker.py index daffe67540..1625d3c158 100644 --- a/bitbake/lib/bb/cooker.py +++ b/bitbake/lib/bb/cooker.py | |||
| @@ -1219,21 +1219,27 @@ class BBCooker: | |||
| 1219 | raise NoSpecificMatch | 1219 | raise NoSpecificMatch |
| 1220 | return matches[0] | 1220 | return matches[0] |
| 1221 | 1221 | ||
| 1222 | def buildFile(self, buildfile, task, hidewarning=False): | 1222 | def buildFile(self, buildfile, task): |
| 1223 | """ | 1223 | """ |
| 1224 | Build the file matching regexp buildfile | 1224 | Build the file matching regexp buildfile |
| 1225 | """ | 1225 | """ |
| 1226 | bb.event.fire(bb.event.BuildInit(), self.data) | 1226 | bb.event.fire(bb.event.BuildInit(), self.data) |
| 1227 | 1227 | ||
| 1228 | if not hidewarning: | 1228 | # Too many people use -b because they think it's how you normally |
| 1229 | # Too many people use -b because they think it's how you normally | 1229 | # specify a target to be built, so show a warning |
| 1230 | # specify a target to be built, so show a warning | 1230 | bb.warn("Buildfile specified, dependencies will not be handled. If this is not what you want, do not use -b / --buildfile.") |
| 1231 | bb.warn("Buildfile specified, dependencies will not be handled. If this is not what you want, do not use -b / --buildfile.") | ||
| 1232 | 1231 | ||
| 1233 | # Parse the configuration here. We need to do it explicitly here since | 1232 | # Parse the configuration here. We need to do it explicitly here since |
| 1234 | # buildFile() doesn't use the cache | 1233 | # buildFile() doesn't use the cache |
| 1235 | self.parseConfiguration() | 1234 | self.parseConfiguration() |
| 1236 | 1235 | ||
| 1236 | self.buildFileInternal(buildfile, task) | ||
| 1237 | |||
| 1238 | def buildFileInternal(self, buildfile, task, fireevents=True, quietlog=False): | ||
| 1239 | """ | ||
| 1240 | Build the file matching regexp buildfile | ||
| 1241 | """ | ||
| 1242 | |||
| 1237 | # If we are told to do the None task then query the default task | 1243 | # If we are told to do the None task then query the default task |
| 1238 | if (task == None): | 1244 | if (task == None): |
| 1239 | task = self.configuration.cmd | 1245 | task = self.configuration.cmd |
| @@ -1270,8 +1276,8 @@ class BBCooker: | |||
| 1270 | # Remove external dependencies | 1276 | # Remove external dependencies |
| 1271 | self.recipecaches[mc].task_deps[fn]['depends'] = {} | 1277 | self.recipecaches[mc].task_deps[fn]['depends'] = {} |
| 1272 | self.recipecaches[mc].deps[fn] = [] | 1278 | self.recipecaches[mc].deps[fn] = [] |
| 1273 | self.recipecaches[mc].rundeps[fn] = [] | 1279 | self.recipecaches[mc].rundeps[fn] = defaultdict(list) |
| 1274 | self.recipecaches[mc].runrecs[fn] = [] | 1280 | self.recipecaches[mc].runrecs[fn] = defaultdict(list) |
| 1275 | 1281 | ||
| 1276 | # Invalidate task for target if force mode active | 1282 | # Invalidate task for target if force mode active |
| 1277 | if self.configuration.force: | 1283 | if self.configuration.force: |
| @@ -1283,8 +1289,13 @@ class BBCooker: | |||
| 1283 | taskdata[mc] = bb.taskdata.TaskData(self.configuration.abort) | 1289 | taskdata[mc] = bb.taskdata.TaskData(self.configuration.abort) |
| 1284 | taskdata[mc].add_provider(self.databuilder.mcdata[mc], self.recipecaches[mc], item) | 1290 | taskdata[mc].add_provider(self.databuilder.mcdata[mc], self.recipecaches[mc], item) |
| 1285 | 1291 | ||
| 1292 | if quietlog: | ||
| 1293 | rqloglevel = bb.runqueue.logger.getEffectiveLevel() | ||
| 1294 | bb.runqueue.logger.setLevel(logging.WARNING) | ||
| 1295 | |||
| 1286 | buildname = self.databuilder.mcdata[mc].getVar("BUILDNAME") | 1296 | buildname = self.databuilder.mcdata[mc].getVar("BUILDNAME") |
| 1287 | bb.event.fire(bb.event.BuildStarted(buildname, [item]), self.databuilder.mcdata[mc]) | 1297 | if fireevents: |
| 1298 | bb.event.fire(bb.event.BuildStarted(buildname, [item]), self.databuilder.mcdata[mc]) | ||
| 1288 | 1299 | ||
| 1289 | # Execute the runqueue | 1300 | # Execute the runqueue |
| 1290 | runlist = [[mc, item, task, fn]] | 1301 | runlist = [[mc, item, task, fn]] |
| @@ -1311,11 +1322,16 @@ class BBCooker: | |||
| 1311 | retval = False | 1322 | retval = False |
| 1312 | except SystemExit as exc: | 1323 | except SystemExit as exc: |
| 1313 | self.command.finishAsyncCommand(str(exc)) | 1324 | self.command.finishAsyncCommand(str(exc)) |
| 1325 | if quietlog: | ||
| 1326 | bb.runqueue.logger.setLevel(rqloglevel) | ||
| 1314 | return False | 1327 | return False |
| 1315 | 1328 | ||
| 1316 | if not retval: | 1329 | if not retval: |
| 1317 | bb.event.fire(bb.event.BuildCompleted(len(rq.rqdata.runtaskentries), buildname, item, failures, interrupted), self.databuilder.mcdata[mc]) | 1330 | if fireevents: |
| 1331 | bb.event.fire(bb.event.BuildCompleted(len(rq.rqdata.runtaskentries), buildname, item, failures, interrupted), self.databuilder.mcdata[mc]) | ||
| 1318 | self.command.finishAsyncCommand(msg) | 1332 | self.command.finishAsyncCommand(msg) |
| 1333 | if quietlog: | ||
| 1334 | bb.runqueue.logger.setLevel(rqloglevel) | ||
| 1319 | return False | 1335 | return False |
| 1320 | if retval is True: | 1336 | if retval is True: |
| 1321 | return True | 1337 | return True |
