bitbake: bitbake-layers: avoid full parse for show-layers subcommand
authorPaul Eggleton <paul.eggleton@linux.intel.com>
Tue, 21 Aug 2012 17:11:46 +0000 (18:11 +0100)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Wed, 22 Aug 2012 12:59:56 +0000 (13:59 +0100)
We don't actually need to parse all recipes just to show the configured
layers, so just parse the configuration instead.

(Bitbake rev: 406477cbae066b6379873e266cb79801e545a61c)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
bitbake/bin/bitbake-layers

index 1dacc25..6d18d94 100755 (executable)
@@ -86,9 +86,13 @@ class Commands(cmd.Cmd):
         self.cooker_data = self.cooker.status
         self.cooker_data.appends = self.cooker.appendlist
 
-    def check_prepare_cooker(self):
+    def check_prepare_cooker(self, config_only = False):
         if not self.cooker_data:
-            self.prepare_cooker()
+            if config_only:
+                self.cooker.parseConfiguration()
+                self.cooker_data = self.cooker.status
+            else:
+                self.prepare_cooker()
 
     def default(self, line):
         """Handle unrecognised commands"""
@@ -113,8 +117,7 @@ class Commands(cmd.Cmd):
 
     def do_show_layers(self, args):
         """show current configured layers"""
-        self.check_prepare_cooker()
-        logger.plain('')
+        self.check_prepare_cooker(config_only = True)
         logger.plain("%s  %s  %s" % ("layer".ljust(20), "path".ljust(40), "priority"))
         logger.plain('=' * 74)
         for layerdir in self.bblayers: