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

login
register
mail settings
Submitter Paul Eggleton
Date Aug. 21, 2012, 5:11 p.m.
Message ID <b3a23c6e0370290e2ab9c411c74c2607d9614118.1345568965.git.paul.eggleton@linux.intel.com>
Download mbox | patch
Permalink /patch/35073/
State New
Headers show

Comments

Paul Eggleton - Aug. 21, 2012, 5:11 p.m.
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@linux.intel.com>
---
 bitbake/bin/bitbake-layers |   11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)

Patch

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: