From 098f63d6727e3b4db0a8906deee52c75f03047fb Mon Sep 17 00:00:00 2001 From: Chris Larson Date: Fri, 10 Dec 2010 16:53:19 -0700 Subject: Rename command events, adjust compareRevisions - Moved the logic for comparing revisions from cooker into command - Removed 'Cooker' from the event names - Renamed the 'ExitCode' event into CommandExit, and changed CommandFailed to be a subclass of CommandExit (Bitbake rev: c51ed5d7a9971fad6019dac6c35a71b8a54ab16a) Signed-off-by: Chris Larson Signed-off-by: Richard Purdie --- bitbake/lib/bb/ui/depexp.py | 10 +++++++--- bitbake/lib/bb/ui/knotty.py | 10 +++++----- bitbake/lib/bb/ui/ncurses.py | 6 ++++-- 3 files changed, 16 insertions(+), 10 deletions(-) (limited to 'bitbake/lib/bb/ui') diff --git a/bitbake/lib/bb/ui/depexp.py b/bitbake/lib/bb/ui/depexp.py index 31004db44a..a6039ec57d 100644 --- a/bitbake/lib/bb/ui/depexp.py +++ b/bitbake/lib/bb/ui/depexp.py @@ -21,6 +21,8 @@ import gobject import gtk import threading import xmlrpclib +import bb +import bb.event from bb.ui.crumbs.progress import ProgressBar # Package Model @@ -236,11 +238,13 @@ def main(server, eventHandler): parse(event._depgraph, dep.pkg_model, dep.depends_model) gtk.gdk.threads_leave() - if isinstance(event, bb.command.CookerCommandCompleted): + if isinstance(event, bb.command.CommandCompleted): continue - if isinstance(event, bb.command.CookerCommandFailed): + if isinstance(event, bb.command.CommandFailed): print("Command execution failed: %s" % event.error) - break + return event.exitcode + if isinstance(event, bb.command.CommandExit): + return event.exitcode if isinstance(event, bb.cooker.CookerExit): break diff --git a/bitbake/lib/bb/ui/knotty.py b/bitbake/lib/bb/ui/knotty.py index e0f08ecb6e..d3534a0f5b 100644 --- a/bitbake/lib/bb/ui/knotty.py +++ b/bitbake/lib/bb/ui/knotty.py @@ -163,15 +163,15 @@ def main(server, eventHandler): % ( event.total, event.cached, event.parsed, event.virtuals, event.skipped, event.masked, event.errors))) continue - if isinstance(event, bb.command.CookerCommandCompleted): + if isinstance(event, bb.command.CommandCompleted): break - if isinstance(event, bb.command.CookerCommandSetExitCode): + if isinstance(event, bb.command.CommandFailed): return_value = event.exitcode - continue - if isinstance(event, bb.command.CookerCommandFailed): - return_value = 1 logger.error("Command execution failed: %s" % event.error) break + if isinstance(event, bb.command.CommandExit): + return_value = event.exitcode + continue if isinstance(event, bb.cooker.CookerExit): break if isinstance(event, bb.event.MultipleProviders): diff --git a/bitbake/lib/bb/ui/ncurses.py b/bitbake/lib/bb/ui/ncurses.py index 3bc8373964..1db4ec173b 100644 --- a/bitbake/lib/bb/ui/ncurses.py +++ b/bitbake/lib/bb/ui/ncurses.py @@ -288,12 +288,14 @@ class NCursesUI: # else: # bb.msg.error(bb.msg.domain.Build, "see log in %s" % logfile) - if isinstance(event, bb.command.CookerCommandCompleted): + if isinstance(event, bb.command.CommandCompleted): exitflag = True - if isinstance(event, bb.command.CookerCommandFailed): + if isinstance(event, bb.command.CommandFailed): mw.appendText("Command execution failed: %s" % event.error) time.sleep(2) exitflag = True + if isinstance(event, bb.command.CommandExit): + exitflag = True if isinstance(event, bb.cooker.CookerExit): exitflag = True -- cgit v1.2.3-54-g00ecf