diff options
author | Cristiana Voicu <cristiana.voicu@intel.com> | 2013-10-04 16:19:45 +0300 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2013-10-07 09:37:34 +0100 |
commit | ee7e64f116608ab105ead99c7f1966158054d2b5 (patch) | |
tree | 63336893f45fe80393c28e72a4cf445eca0cfb8c /bitbake/lib/bb/ui/crumbs | |
parent | 45392cc67a89afe468b179789c7fbeeb3aa67769 (diff) | |
download | poky-ee7e64f116608ab105ead99c7f1966158054d2b5.tar.gz |
bitbake: bitbake/hob: removing extra parameters from conf files using hob
In Hob settings, there is a tab to add/remove extra settings. This
patch implements a way to "remove" variables from conf files, through
bitbake. But, to keep the history assigment of the variables synchronized,
instead of removing, it replaces the lines with blank lines.
[YOCTO #5284]
(Bitbake rev: bd720fb63cef6b399619b8fbcaeb8d7710f2d6df)
Signed-off-by: Cristiana Voicu <cristiana.voicu@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/lib/bb/ui/crumbs')
-rwxr-xr-x | bitbake/lib/bb/ui/crumbs/builder.py | 2 | ||||
-rw-r--r-- | bitbake/lib/bb/ui/crumbs/hobeventhandler.py | 17 |
2 files changed, 18 insertions, 1 deletions
diff --git a/bitbake/lib/bb/ui/crumbs/builder.py b/bitbake/lib/bb/ui/crumbs/builder.py index 46023cc585..ab6750b741 100755 --- a/bitbake/lib/bb/ui/crumbs/builder.py +++ b/bitbake/lib/bb/ui/crumbs/builder.py | |||
@@ -218,7 +218,7 @@ class Configuration: | |||
218 | handler.set_var_in_file("SDKMACHINE", self.curr_sdk_machine, "local.conf") | 218 | handler.set_var_in_file("SDKMACHINE", self.curr_sdk_machine, "local.conf") |
219 | handler.set_var_in_file("CONF_VERSION", self.conf_version, "local.conf") | 219 | handler.set_var_in_file("CONF_VERSION", self.conf_version, "local.conf") |
220 | handler.set_var_in_file("LCONF_VERSION", self.lconf_version, "bblayers.conf") | 220 | handler.set_var_in_file("LCONF_VERSION", self.lconf_version, "bblayers.conf") |
221 | handler.set_var_in_file("EXTRA_SETTING", self.extra_setting, "local.conf") | 221 | handler.set_extra_config(self.extra_setting) |
222 | handler.set_var_in_file("TOOLCHAIN_BUILD", self.toolchain_build, "local.conf") | 222 | handler.set_var_in_file("TOOLCHAIN_BUILD", self.toolchain_build, "local.conf") |
223 | handler.set_var_in_file("IMAGE_FSTYPES", self.image_fstypes, "local.conf") | 223 | handler.set_var_in_file("IMAGE_FSTYPES", self.image_fstypes, "local.conf") |
224 | if not defaults: | 224 | if not defaults: |
diff --git a/bitbake/lib/bb/ui/crumbs/hobeventhandler.py b/bitbake/lib/bb/ui/crumbs/hobeventhandler.py index 3f5bebaca3..393c258e46 100644 --- a/bitbake/lib/bb/ui/crumbs/hobeventhandler.py +++ b/bitbake/lib/bb/ui/crumbs/hobeventhandler.py | |||
@@ -21,6 +21,7 @@ | |||
21 | 21 | ||
22 | import gobject | 22 | import gobject |
23 | import logging | 23 | import logging |
24 | import ast | ||
24 | from bb.ui.crumbs.runningbuild import RunningBuild | 25 | from bb.ui.crumbs.runningbuild import RunningBuild |
25 | 26 | ||
26 | class HobHandler(gobject.GObject): | 27 | class HobHandler(gobject.GObject): |
@@ -357,7 +358,20 @@ class HobHandler(gobject.GObject): | |||
357 | def set_incompatible_license(self, incompat_license): | 358 | def set_incompatible_license(self, incompat_license): |
358 | self.set_var_in_file("INCOMPATIBLE_LICENSE", incompat_license, "local.conf") | 359 | self.set_var_in_file("INCOMPATIBLE_LICENSE", incompat_license, "local.conf") |
359 | 360 | ||
361 | def set_extra_setting(self, extra_setting): | ||
362 | self.set_var_in_file("EXTRA_SETTING", extra_setting, "local.conf") | ||
363 | |||
360 | def set_extra_config(self, extra_setting): | 364 | def set_extra_config(self, extra_setting): |
365 | old_extra_setting = ast.literal_eval(self.runCommand(["getVariable", "EXTRA_SETTING"]) or "{}") | ||
366 | if extra_setting: | ||
367 | self.set_var_in_file("EXTRA_SETTING", extra_setting, "local.conf") | ||
368 | else: | ||
369 | self.remove_var_from_file("EXTRA_SETTING") | ||
370 | |||
371 | #remove not needed settings from conf | ||
372 | for key in old_extra_setting: | ||
373 | if key not in extra_setting: | ||
374 | self.remove_var_from_file(key) | ||
361 | for key in extra_setting.keys(): | 375 | for key in extra_setting.keys(): |
362 | value = extra_setting[key] | 376 | value = extra_setting[key] |
363 | self.set_var_in_file(key, value, "local.conf") | 377 | self.set_var_in_file(key, value, "local.conf") |
@@ -477,6 +491,9 @@ class HobHandler(gobject.GObject): | |||
477 | self.server.runCommand(["setVarFile", var, val, default_file, "earlyAssign"]) | 491 | self.server.runCommand(["setVarFile", var, val, default_file, "earlyAssign"]) |
478 | self.runCommand(["disableDataTracking"]) | 492 | self.runCommand(["disableDataTracking"]) |
479 | 493 | ||
494 | def remove_var_from_file(self, var): | ||
495 | self.server.runCommand(["removeVarFile", var]) | ||
496 | |||
480 | def append_var_in_file(self, var, val, default_file=None): | 497 | def append_var_in_file(self, var, val, default_file=None): |
481 | self.server.runCommand(["setVarFile", var, val, default_file, "append"]) | 498 | self.server.runCommand(["setVarFile", var, val, default_file, "append"]) |
482 | 499 | ||