]> git.ipfire.org Git - thirdparty/openembedded/openembedded-core-contrib.git/commitdiff
cooker: updateCache should rause exceptions, not sys.exit
authorRichard Purdie <richard.purdie@linuxfoundation.org>
Fri, 13 Sep 2013 16:34:42 +0000 (17:34 +0100)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Fri, 13 Sep 2013 16:45:37 +0000 (17:45 +0100)
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>
lib/bb/cooker.py

index 0a4dc7eb6253f5dc0131b5ae4242e5acde3256ad..a07615b04c7e4a704d0dc903f92dea5bcbc2865d 100644 (file)
@@ -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)