From e6a1b33bc87ea205b5d4ea8cf29159fc6ddd8853 Mon Sep 17 00:00:00 2001 From: Alexandru DAMIAN Date: Tue, 28 May 2013 12:49:55 +0000 Subject: bitbake: bitbake: move extra cache collection out of cooker The collection of the extra caching data should not be performed by the cooker, but supplied to it. This patch will also streamline the code for launching servers without a UI attached. Based on a patch by Bogdan Marinescu (Bitbake rev: f0b54280a6bce522508e4741e5f507bc284113a8) Signed-off-by: Alexandru DAMIAN Signed-off-by: Richard Purdie --- bitbake/bin/bitbake | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'bitbake/bin/bitbake') diff --git a/bitbake/bin/bitbake b/bitbake/bin/bitbake index 86cf3a8ae8..f44543de2c 100755 --- a/bitbake/bin/bitbake +++ b/bitbake/bin/bitbake @@ -75,6 +75,18 @@ def get_ui(config): sys.exit("FATAL: Invalid user interface '%s' specified.\n" "Valid interfaces: depexp, goggle, ncurses, hob, knotty [default]." % interface) +def gather_extra_cache_data(): + extra = [] + interfaces = ['depexp', 'goggle', 'ncurses', 'hob', 'knotty'] + for i in interfaces: + try: + ui = __import__("bb.ui." + i, fromlist = [i]) + if hasattr(ui, "extraCaches"): + extra = extra + ui.extraCaches + del ui + except: + pass + return extra # Display bitbake/OE warnings via the BitBake.Warnings logger, ignoring others""" warnlog = logging.getLogger("BitBake.Warnings") @@ -237,6 +249,12 @@ def main(): try: configuration.setServerRegIdleCallback(server.getServerIdleCB()) + + if configParams.server_only: + configuration.extra_caches = gather_extra_cache_data() + else: + configuration.extra_caches = getattr(ui_module, "extraCaches", []) + cooker = bb.cooker.BBCooker(configuration) server.addcooker(cooker) -- cgit v1.2.3-54-g00ecf