summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPaul Eggleton <paul.eggleton@linux.intel.com>2013-11-21 14:09:46 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2013-11-24 12:25:37 +0000
commit4ca910d4cf8bf36723bfd4fd93d33ae1e64e92b7 (patch)
treebb4090b5a06c4b234be5a8bb5e4e136682168283
parent300b6f7f49857d5e6a86610003a7753a2f1daed6 (diff)
downloadpoky-4ca910d4cf8bf36723bfd4fd93d33ae1e64e92b7.tar.gz
bitbake: bitbake-layers: avoid loading configuration when not needed
In recent versions of bitbake, it is not possible to initialise a BBCooker object without having it load the configuration first. Thus we should avoid creating the Tinfoil object here in bitbake-layers which does that internally until we actually need to, so you can run "bitbake-layers help" and not have to wait several seconds for the output. (Bitbake rev: 8f1e280fbbb6432d7bcc1fb4241f402668c6c5ea) Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rwxr-xr-xbitbake/bin/bitbake-layers24
1 files changed, 15 insertions, 9 deletions
diff --git a/bitbake/bin/bitbake-layers b/bitbake/bin/bitbake-layers
index 047583c497..2a7f82998b 100755
--- a/bitbake/bin/bitbake-layers
+++ b/bitbake/bin/bitbake-layers
@@ -55,10 +55,16 @@ def main(args):
55 55
56class Commands(cmd.Cmd): 56class Commands(cmd.Cmd):
57 def __init__(self): 57 def __init__(self):
58 cmd.Cmd.__init__(self) 58 self.bbhandler = None
59 self.bbhandler = bb.tinfoil.Tinfoil()
60 self.returncode = 0 59 self.returncode = 0
61 self.bblayers = (self.bbhandler.config_data.getVar('BBLAYERS', True) or "").split() 60 self.bblayers = []
61 cmd.Cmd.__init__(self)
62
63 def init_bbhandler(self, config_only = False):
64 if not self.bbhandler:
65 self.bbhandler = bb.tinfoil.Tinfoil()
66 self.bblayers = (self.bbhandler.config_data.getVar('BBLAYERS', True) or "").split()
67 self.bbhandler.prepare(config_only)
62 68
63 def default(self, line): 69 def default(self, line):
64 """Handle unrecognised commands""" 70 """Handle unrecognised commands"""
@@ -83,7 +89,7 @@ class Commands(cmd.Cmd):
83 89
84 def do_show_layers(self, args): 90 def do_show_layers(self, args):
85 """show current configured layers""" 91 """show current configured layers"""
86 self.bbhandler.prepare(config_only = True) 92 self.init_bbhandler(config_only = True)
87 logger.plain("%s %s %s" % ("layer".ljust(20), "path".ljust(40), "priority")) 93 logger.plain("%s %s %s" % ("layer".ljust(20), "path".ljust(40), "priority"))
88 logger.plain('=' * 74) 94 logger.plain('=' * 74)
89 for layerdir in self.bblayers: 95 for layerdir in self.bblayers:
@@ -120,7 +126,7 @@ Options:
120 recipes with the ones they overlay indented underneath 126 recipes with the ones they overlay indented underneath
121 -s only list overlayed recipes where the version is the same 127 -s only list overlayed recipes where the version is the same
122""" 128"""
123 self.bbhandler.prepare() 129 self.init_bbhandler()
124 130
125 show_filenames = False 131 show_filenames = False
126 show_same_ver_only = False 132 show_same_ver_only = False
@@ -203,7 +209,7 @@ Options:
203 -m only list where multiple recipes (in the same layer or different 209 -m only list where multiple recipes (in the same layer or different
204 layers) exist for the same recipe name 210 layers) exist for the same recipe name
205""" 211"""
206 self.bbhandler.prepare() 212 self.init_bbhandler()
207 213
208 show_filenames = False 214 show_filenames = False
209 show_multi_provider_only = False 215 show_multi_provider_only = False
@@ -341,7 +347,7 @@ build results (as the layer priority order has effectively changed).
341 logger.error('Directory %s exists and is non-empty, please clear it out first' % outputdir) 347 logger.error('Directory %s exists and is non-empty, please clear it out first' % outputdir)
342 return 348 return
343 349
344 self.bbhandler.prepare() 350 self.init_bbhandler()
345 layers = self.bblayers 351 layers = self.bblayers
346 if len(arglist) > 2: 352 if len(arglist) > 2:
347 layernames = arglist[:-1] 353 layernames = arglist[:-1]
@@ -497,7 +503,7 @@ usage: show-appends
497 503
498Recipes are listed with the bbappends that apply to them as subitems. 504Recipes are listed with the bbappends that apply to them as subitems.
499""" 505"""
500 self.bbhandler.prepare() 506 self.init_bbhandler()
501 if not self.bbhandler.cooker.collection.appendlist: 507 if not self.bbhandler.cooker.collection.appendlist:
502 logger.plain('No append files found') 508 logger.plain('No append files found')
503 return 509 return
@@ -570,7 +576,7 @@ Options:
570NOTE: 576NOTE:
571The .bbappend file can impact the dependency. 577The .bbappend file can impact the dependency.
572""" 578"""
573 self.bbhandler.prepare() 579 self.init_bbhandler()
574 580
575 show_filenames = False 581 show_filenames = False
576 for arg in args.split(): 582 for arg in args.split():