diff options
author | Richard Purdie <richard.purdie@linuxfoundation.org> | 2017-08-31 17:04:49 +0100 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2017-08-31 23:30:03 +0100 |
commit | 5759039a89674c1e11b3d73cd6487f4586d25a73 (patch) | |
tree | 2021e328c88b221a71dd385a303b67f266fa0ab2 /bitbake | |
parent | 313bf30db7bda51a061bae9c8d9c489e4a7c0167 (diff) | |
download | poky-5759039a89674c1e11b3d73cd6487f4586d25a73.tar.gz |
bitbake: cooker: Handle datastore tracking for showEnvironment server side only
The current passing of "tracking" backwards and forwards, client to server
is ugly and complex and error prone. Instead, set this during showEnvironment
commands triggering a reset there if/as required.
(Bitbake rev: 9dc7f384db0479569ff93a76a623d5395fecaf47)
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake')
-rw-r--r-- | bitbake/lib/bb/cooker.py | 11 | ||||
-rw-r--r-- | bitbake/lib/bb/cookerdata.py | 7 |
2 files changed, 11 insertions, 7 deletions
diff --git a/bitbake/lib/bb/cooker.py b/bitbake/lib/bb/cooker.py index 2ee349e041..ad08c473ae 100644 --- a/bitbake/lib/bb/cooker.py +++ b/bitbake/lib/bb/cooker.py | |||
@@ -415,7 +415,7 @@ class BBCooker: | |||
415 | self.ui_cmdline = cmdline | 415 | self.ui_cmdline = cmdline |
416 | clean = True | 416 | clean = True |
417 | for o in options: | 417 | for o in options: |
418 | if o in ['prefile', 'postfile', 'tracking']: | 418 | if o in ['prefile', 'postfile']: |
419 | server_val = getattr(self.configuration, "%s_server" % o, None) | 419 | server_val = getattr(self.configuration, "%s_server" % o, None) |
420 | if not options[o] and server_val: | 420 | if not options[o] and server_val: |
421 | # restore value provided on server start | 421 | # restore value provided on server start |
@@ -486,6 +486,12 @@ class BBCooker: | |||
486 | if not pkgs_to_build: | 486 | if not pkgs_to_build: |
487 | pkgs_to_build = [] | 487 | pkgs_to_build = [] |
488 | 488 | ||
489 | orig_tracking = self.configuration.tracking | ||
490 | if not orig_tracking: | ||
491 | self.enableDataTracking() | ||
492 | self.reset() | ||
493 | |||
494 | |||
489 | if buildfile: | 495 | if buildfile: |
490 | # Parse the configuration here. We need to do it explicitly here since | 496 | # Parse the configuration here. We need to do it explicitly here since |
491 | # this showEnvironment() code path doesn't use the cache | 497 | # this showEnvironment() code path doesn't use the cache |
@@ -530,6 +536,9 @@ class BBCooker: | |||
530 | if envdata.getVarFlag(e, 'func', False) and envdata.getVarFlag(e, 'python', False): | 536 | if envdata.getVarFlag(e, 'func', False) and envdata.getVarFlag(e, 'python', False): |
531 | logger.plain("\npython %s () {\n%s}\n", e, envdata.getVar(e, False)) | 537 | logger.plain("\npython %s () {\n%s}\n", e, envdata.getVar(e, False)) |
532 | 538 | ||
539 | if not orig_tracking: | ||
540 | self.disableDataTracking() | ||
541 | self.reset() | ||
533 | 542 | ||
534 | def buildTaskData(self, pkgs_to_build, task, abort, allowincomplete=False): | 543 | def buildTaskData(self, pkgs_to_build, task, abort, allowincomplete=False): |
535 | """ | 544 | """ |
diff --git a/bitbake/lib/bb/cookerdata.py b/bitbake/lib/bb/cookerdata.py index 55c6ea83cb..197db6215e 100644 --- a/bitbake/lib/bb/cookerdata.py +++ b/bitbake/lib/bb/cookerdata.py | |||
@@ -41,10 +41,6 @@ class ConfigParameters(object): | |||
41 | 41 | ||
42 | self.options.pkgs_to_build = targets or [] | 42 | self.options.pkgs_to_build = targets or [] |
43 | 43 | ||
44 | self.options.tracking = False | ||
45 | if hasattr(self.options, "show_environment") and self.options.show_environment: | ||
46 | self.options.tracking = True | ||
47 | |||
48 | for key, val in self.options.__dict__.items(): | 44 | for key, val in self.options.__dict__.items(): |
49 | setattr(self, key, val) | 45 | setattr(self, key, val) |
50 | 46 | ||
@@ -76,7 +72,7 @@ class ConfigParameters(object): | |||
76 | for o in ["abort", "tryaltconfigs", "force", "invalidate_stamp", | 72 | for o in ["abort", "tryaltconfigs", "force", "invalidate_stamp", |
77 | "verbose", "debug", "dry_run", "dump_signatures", | 73 | "verbose", "debug", "dry_run", "dump_signatures", |
78 | "debug_domains", "extra_assume_provided", "profile", | 74 | "debug_domains", "extra_assume_provided", "profile", |
79 | "prefile", "postfile", "tracking", "server_timeout"]: | 75 | "prefile", "postfile", "server_timeout"]: |
80 | options[o] = getattr(self.options, o) | 76 | options[o] = getattr(self.options, o) |
81 | 77 | ||
82 | ret, error = server.runCommand(["updateConfig", options, environment, sys.argv]) | 78 | ret, error = server.runCommand(["updateConfig", options, environment, sys.argv]) |
@@ -158,7 +154,6 @@ class CookerConfiguration(object): | |||
158 | if key in parameters.options.__dict__: | 154 | if key in parameters.options.__dict__: |
159 | setattr(self, key, parameters.options.__dict__[key]) | 155 | setattr(self, key, parameters.options.__dict__[key]) |
160 | self.env = parameters.environment.copy() | 156 | self.env = parameters.environment.copy() |
161 | self.tracking = parameters.tracking | ||
162 | 157 | ||
163 | def setServerRegIdleCallback(self, srcb): | 158 | def setServerRegIdleCallback(self, srcb): |
164 | self.server_register_idlecallback = srcb | 159 | self.server_register_idlecallback = srcb |