diff options
author | Dongxiao Xu <dongxiao.xu@intel.com> | 2012-04-24 16:16:12 +0800 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2012-04-24 10:14:48 +0100 |
commit | 2a6e1b0a0ccd11806723be7d9959c387f5ecbe17 (patch) | |
tree | 088364bd4ce625341fa12ef665d024b2dd3559c7 /bitbake/lib/bb/ui/crumbs/hobeventhandler.py | |
parent | 544553b12b3ca111abd555f84eab1e68f648b829 (diff) | |
download | poky-2a6e1b0a0ccd11806723be7d9959c387f5ecbe17.tar.gz |
Hob: Issue sanity check after parse is completed
In original scheme, sanity check is part of the parsing process. If a
sanity check fails, it means the parsing is failed and values in Hob
GUI may not correct.
With this commit, Hob will actively issue sanity_check() after the
parsing is completed.
This fixes [YOCTO #2361]
(Bitbake rev: 36968815dcc91759eeacb308bf4b294af416eee5)
Signed-off-by: Dongxiao Xu <dongxiao.xu@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/lib/bb/ui/crumbs/hobeventhandler.py')
-rw-r--r-- | bitbake/lib/bb/ui/crumbs/hobeventhandler.py | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/bitbake/lib/bb/ui/crumbs/hobeventhandler.py b/bitbake/lib/bb/ui/crumbs/hobeventhandler.py index c918aad8dc..a07afddead 100644 --- a/bitbake/lib/bb/ui/crumbs/hobeventhandler.py +++ b/bitbake/lib/bb/ui/crumbs/hobeventhandler.py | |||
@@ -59,8 +59,8 @@ class HobHandler(gobject.GObject): | |||
59 | (gobject.TYPE_PYOBJECT,)), | 59 | (gobject.TYPE_PYOBJECT,)), |
60 | } | 60 | } |
61 | 61 | ||
62 | (GENERATE_CONFIGURATION, GENERATE_RECIPES, GENERATE_PACKAGES, GENERATE_IMAGE, POPULATE_PACKAGEINFO) = range(5) | 62 | (GENERATE_CONFIGURATION, GENERATE_RECIPES, GENERATE_PACKAGES, GENERATE_IMAGE, POPULATE_PACKAGEINFO, SANITY_CHECK) = range(6) |
63 | (SUB_PATH_LAYERS, SUB_FILES_DISTRO, SUB_FILES_MACH, SUB_FILES_SDKMACH, SUB_MATCH_CLASS, SUB_PARSE_CONFIG, SUB_GNERATE_TGTS, SUB_GENERATE_PKGINFO, SUB_BUILD_RECIPES, SUB_BUILD_IMAGE) = range(10) | 63 | (SUB_PATH_LAYERS, SUB_FILES_DISTRO, SUB_FILES_MACH, SUB_FILES_SDKMACH, SUB_MATCH_CLASS, SUB_PARSE_CONFIG, SUB_SANITY_CHECK, SUB_GNERATE_TGTS, SUB_GENERATE_PKGINFO, SUB_BUILD_RECIPES, SUB_BUILD_IMAGE) = range(11) |
64 | 64 | ||
65 | def __init__(self, server, recipe_model, package_model): | 65 | def __init__(self, server, recipe_model, package_model): |
66 | super(HobHandler, self).__init__() | 66 | super(HobHandler, self).__init__() |
@@ -129,6 +129,8 @@ class HobHandler(gobject.GObject): | |||
129 | self.runCommand(["generateTargetsTree", "classes/image.bbclass", []]) | 129 | self.runCommand(["generateTargetsTree", "classes/image.bbclass", []]) |
130 | elif next_command == self.SUB_GENERATE_PKGINFO: | 130 | elif next_command == self.SUB_GENERATE_PKGINFO: |
131 | self.runCommand(["triggerEvent", "bb.event.RequestPackageInfo()"]) | 131 | self.runCommand(["triggerEvent", "bb.event.RequestPackageInfo()"]) |
132 | elif next_command == self.SUB_SANITY_CHECK: | ||
133 | self.runCommand(["triggerEvent", "bb.event.SanityCheck()"]) | ||
132 | elif next_command == self.SUB_BUILD_RECIPES: | 134 | elif next_command == self.SUB_BUILD_RECIPES: |
133 | self.clear_busy() | 135 | self.clear_busy() |
134 | self.building = True | 136 | self.building = True |
@@ -158,6 +160,9 @@ class HobHandler(gobject.GObject): | |||
158 | self.package_model.populate(event._pkginfolist) | 160 | self.package_model.populate(event._pkginfolist) |
159 | self.run_next_command() | 161 | self.run_next_command() |
160 | 162 | ||
163 | elif isinstance(event, bb.event.SanityCheckPassed): | ||
164 | self.run_next_command() | ||
165 | |||
161 | elif isinstance(event, logging.LogRecord): | 166 | elif isinstance(event, logging.LogRecord): |
162 | if event.levelno >= logging.ERROR: | 167 | if event.levelno >= logging.ERROR: |
163 | self.error_msg += event.msg + '\n' | 168 | self.error_msg += event.msg + '\n' |
@@ -233,9 +238,6 @@ class HobHandler(gobject.GObject): | |||
233 | inherits = inherits + " " + bbclass | 238 | inherits = inherits + " " + bbclass |
234 | self.runCommand(["setVariable", "INHERIT", inherits]) | 239 | self.runCommand(["setVariable", "INHERIT", inherits]) |
235 | 240 | ||
236 | def enable_sanity(self): | ||
237 | self.runCommand(["setVariable", "DISABLE_SANITY_CHECKS", "0"]) | ||
238 | |||
239 | def set_bblayers(self, bblayers): | 241 | def set_bblayers(self, bblayers): |
240 | self.runCommand(["setVariable", "BBLAYERS_HOB", " ".join(bblayers)]) | 242 | self.runCommand(["setVariable", "BBLAYERS_HOB", " ".join(bblayers)]) |
241 | 243 | ||
@@ -315,6 +317,10 @@ class HobHandler(gobject.GObject): | |||
315 | self.commands_async.append(self.SUB_GENERATE_PKGINFO) | 317 | self.commands_async.append(self.SUB_GENERATE_PKGINFO) |
316 | self.run_next_command(self.POPULATE_PACKAGEINFO) | 318 | self.run_next_command(self.POPULATE_PACKAGEINFO) |
317 | 319 | ||
320 | def trigger_sanity_check(self): | ||
321 | self.commands_async.append(self.SUB_SANITY_CHECK) | ||
322 | self.run_next_command(self.SANITY_CHECK) | ||
323 | |||
318 | def generate_configuration(self): | 324 | def generate_configuration(self): |
319 | self.commands_async.append(self.SUB_PARSE_CONFIG) | 325 | self.commands_async.append(self.SUB_PARSE_CONFIG) |
320 | self.commands_async.append(self.SUB_PATH_LAYERS) | 326 | self.commands_async.append(self.SUB_PATH_LAYERS) |