summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPaul Eggleton <paul.eggleton@linux.intel.com>2011-07-22 17:03:55 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2011-07-25 12:54:17 +0100
commit27edc7c1a906e38376054ad2a362ae213a45ba1b (patch)
tree2475709822cf65f166a14aede3b7171572ef6d33
parentbc4aefff9867d3a0fb502f99e086337561ee8a2f (diff)
downloadpoky-27edc7c1a906e38376054ad2a362ae213a45ba1b.tar.gz
bitbake-layers: check for errors before parsing
Don't always parse on initialisation - instead check for errors and then parse when we know we need to. Avoids keeping the user waiting. (Bitbake rev: 86adaca6ce959ad5e908c394625bc9880f3c0216) Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rwxr-xr-xbitbake/bin/bitbake-layers10
1 files changed, 9 insertions, 1 deletions
diff --git a/bitbake/bin/bitbake-layers b/bitbake/bin/bitbake-layers
index 1c48c8c92d..56253f5d28 100755
--- a/bitbake/bin/bitbake-layers
+++ b/bitbake/bin/bitbake-layers
@@ -48,7 +48,7 @@ class Commands(cmd.Cmd):
48 self.register_idle_function) 48 self.register_idle_function)
49 self.config_data = self.cooker.configuration.data 49 self.config_data = self.cooker.configuration.data
50 bb.providers.logger.setLevel(logging.ERROR) 50 bb.providers.logger.setLevel(logging.ERROR)
51 self.prepare_cooker() 51 self.cooker_data = None
52 52
53 def register_idle_function(self, function, data): 53 def register_idle_function(self, function, data):
54 pass 54 pass
@@ -71,10 +71,16 @@ class Commands(cmd.Cmd):
71 self.cooker_data = self.cooker.status 71 self.cooker_data = self.cooker.status
72 self.cooker_data.appends = self.cooker.appendlist 72 self.cooker_data.appends = self.cooker.appendlist
73 73
74 def check_prepare_cooker(self):
75 if not self.cooker_data:
76 self.prepare_cooker()
77
74 def do_show_layers(self, args): 78 def do_show_layers(self, args):
79 self.check_prepare_cooker()
75 logger.info(str(self.config_data.getVar('BBLAYERS', True))) 80 logger.info(str(self.config_data.getVar('BBLAYERS', True)))
76 81
77 def do_show_overlayed(self, args): 82 def do_show_overlayed(self, args):
83 self.check_prepare_cooker()
78 if self.cooker.overlayed: 84 if self.cooker.overlayed:
79 logger.info('Overlayed recipes:') 85 logger.info('Overlayed recipes:')
80 for f in self.cooker.overlayed.iterkeys(): 86 for f in self.cooker.overlayed.iterkeys():
@@ -94,6 +100,7 @@ class Commands(cmd.Cmd):
94 logger.error('Directory %s exists and is non-empty, please clear it out first' % arglist[0]) 100 logger.error('Directory %s exists and is non-empty, please clear it out first' % arglist[0])
95 return 101 return
96 102
103 self.check_prepare_cooker()
97 layers = (self.config_data.getVar('BBLAYERS', True) or "").split() 104 layers = (self.config_data.getVar('BBLAYERS', True) or "").split()
98 for layer in layers: 105 for layer in layers:
99 overlayed = [] 106 overlayed = []
@@ -143,6 +150,7 @@ class Commands(cmd.Cmd):
143 recipefile.writelines(appendfile.readlines()) 150 recipefile.writelines(appendfile.readlines())
144 151
145 def do_show_appends(self, args): 152 def do_show_appends(self, args):
153 self.check_prepare_cooker()
146 if not self.cooker_data.appends: 154 if not self.cooker_data.appends:
147 logger.info('No append files found') 155 logger.info('No append files found')
148 return 156 return