]> git.ipfire.org Git - thirdparty/openembedded/openembedded-core-contrib.git/commitdiff
bin/bitbake, bb/__init__: Move BBDEBUG handling to bin/bitbake
authorRichard Purdie <richard.purdie@linuxfoundation.org>
Fri, 14 Dec 2012 12:30:27 +0000 (12:30 +0000)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Fri, 14 Dec 2012 12:35:38 +0000 (12:35 +0000)
The method this older code was accessing doesn't exist. A library shouldn't
be changing behaviour based on the environment anyway when sepcific function
calls exist to correctly setup the logging. Fix the crash if BBDEBUG was used
by moving the code to bin/bitbake.

[YOCTO #3319]

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
bin/bitbake
lib/bb/__init__.py

index 324ee4fa53b7f369489a26f4e9cc8ba43239ef20..e86d59bd6238453a8a11a91c7909db978b170833 100755 (executable)
@@ -214,6 +214,11 @@ Default BBFILES are the .bb files in the current directory.""")
     if configuration.bind and configuration.servertype != "xmlrpc":
         sys.exit("FATAL: If '-B' or '--bind' is defined, we must set the servertype as 'xmlrpc'.\n")
 
+    if "BBDEBUG" in os.environ:
+        level = int(os.environ["BBDEBUG"])
+        if level > configuration.debug:
+            configuration.debug = level
+
     bb.msg.init_msgconfig(configuration.verbose, configuration.debug,
                          configuration.debug_domains)
 
index 660fd5bf5a2ace505d375ee768063e556e463b92..faa94e6c36d858145176759c56b6cd4398e1e709 100644 (file)
@@ -74,11 +74,6 @@ logger.setLevel(logging.DEBUG - 2)
 # can result in construction of the various loggers.
 import bb.msg
 
-if "BBDEBUG" in os.environ:
-    level = int(os.environ["BBDEBUG"])
-    if level:
-        bb.msg.set_debug_level(level)
-
 from bb import fetch2 as fetch
 sys.modules['bb.fetch'] = sys.modules['bb.fetch2']