[bitbake-devel] [PATCH 2/3] bitbake-layers: avoid full parse for show-layers subcommand

Paul Eggleton paul.eggleton at linux.intel.com
Tue Aug 21 17:11:46 UTC 2012


We don't actually need to parse all recipes just to show the configured
layers, so just parse the configuration instead.

Signed-off-by: Paul Eggleton <paul.eggleton at linux.intel.com>
---
 bitbake/bin/bitbake-layers |   11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)

diff --git a/bitbake/bin/bitbake-layers b/bitbake/bin/bitbake-layers
index 1dacc25..6d18d94 100755
--- a/bitbake/bin/bitbake-layers
+++ b/bitbake/bin/bitbake-layers
@@ -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:
-- 
1.7.9.5





More information about the bitbake-devel mailing list