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>
This commit is contained in:
Richard Purdie
2017-08-31 17:04:49 +01:00
parent 313bf30db7
commit 5759039a89
2 changed files with 11 additions and 7 deletions

View File

@@ -415,7 +415,7 @@ class BBCooker:
self.ui_cmdline = cmdline
clean = True
for o in options:
if o in ['prefile', 'postfile', 'tracking']:
if o in ['prefile', 'postfile']:
server_val = getattr(self.configuration, "%s_server" % o, None)
if not options[o] and server_val:
# restore value provided on server start
@@ -486,6 +486,12 @@ class BBCooker:
if not pkgs_to_build:
pkgs_to_build = []
orig_tracking = self.configuration.tracking
if not orig_tracking:
self.enableDataTracking()
self.reset()
if buildfile:
# Parse the configuration here. We need to do it explicitly here since
# this showEnvironment() code path doesn't use the cache
@@ -530,6 +536,9 @@ class BBCooker:
if envdata.getVarFlag(e, 'func', False) and envdata.getVarFlag(e, 'python', False):
logger.plain("\npython %s () {\n%s}\n", e, envdata.getVar(e, False))
if not orig_tracking:
self.disableDataTracking()
self.reset()
def buildTaskData(self, pkgs_to_build, task, abort, allowincomplete=False):
"""

View File

@@ -41,10 +41,6 @@ class ConfigParameters(object):
self.options.pkgs_to_build = targets or []
self.options.tracking = False
if hasattr(self.options, "show_environment") and self.options.show_environment:
self.options.tracking = True
for key, val in self.options.__dict__.items():
setattr(self, key, val)
@@ -76,7 +72,7 @@ class ConfigParameters(object):
for o in ["abort", "tryaltconfigs", "force", "invalidate_stamp",
"verbose", "debug", "dry_run", "dump_signatures",
"debug_domains", "extra_assume_provided", "profile",
"prefile", "postfile", "tracking", "server_timeout"]:
"prefile", "postfile", "server_timeout"]:
options[o] = getattr(self.options, o)
ret, error = server.runCommand(["updateConfig", options, environment, sys.argv])
@@ -158,7 +154,6 @@ class CookerConfiguration(object):
if key in parameters.options.__dict__:
setattr(self, key, parameters.options.__dict__[key])
self.env = parameters.environment.copy()
self.tracking = parameters.tracking
def setServerRegIdleCallback(self, srcb):
self.server_register_idlecallback = srcb