All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] cooker: updateCache should rause exceptions, not sys.exit
@ 2013-09-13 16:34 Richard Purdie
  0 siblings, 0 replies; only message in thread
From: Richard Purdie @ 2013-09-13 16:34 UTC (permalink / raw)
  To: bitbake-devel

Exiting from the server is antisocial, instead we should raise an exception. This
will correctly fail the current command and reset the server state. We use
the handled exception since for these conditions to occur, something was
already displayed to the user.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
---
diff --git a/bitbake/lib/bb/cooker.py b/bitbake/lib/bb/cooker.py
index 0a4dc7e..a07615b 100644
--- a/bitbake/lib/bb/cooker.py
+++ b/bitbake/lib/bb/cooker.py
@@ -1172,7 +1172,7 @@ class BBCooker:
 
         if self.state in (state.shutdown, state.forceshutdown):
             self.parser.shutdown(clean=False, force = True)
-            sys.exit(1)
+            raise bb.BBHandledException()
 
         if self.state != state.parsing:
             self.parseConfiguration ()
@@ -1194,7 +1194,7 @@ class BBCooker:
         if not self.parser.parse_next():
             collectlog.debug(1, "parsing complete")
             if self.parser.error:
-                sys.exit(1)
+                raise bb.BBHandledException()
             self.show_appends_with_no_recipes()
             self.handlePrefProviders()
             self.recipecache.bbfile_priority = self.collection.collection_priorities(self.recipecache.pkg_fn)




^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2013-09-13 16:34 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-09-13 16:34 [PATCH] cooker: updateCache should rause exceptions, not sys.exit Richard Purdie

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.