aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorChris Larson <clarson@kergoth.com>2004-12-09 10:27:57 +0000
committerChris Larson <clarson@kergoth.com>2004-12-09 10:27:57 +0000
commita699538fcfbb08c520985cc4d8d1256fb89e2c32 (patch)
tree1c5c635d34b265761ca676c1675f1a24e4e40c87 /lib
parent066a946940373baeffb5655f395d7cff29d0c0c2 (diff)
downloadbitbake-a699538fcfbb08c520985cc4d8d1256fb89e2c32.tar.gz
Apply patch from seb (proti) to fix OEDEBUG and add a debug commandline argument.
Diffstat (limited to 'lib')
-rw-r--r--lib/bb/__init__.py12
1 files changed, 10 insertions, 2 deletions
diff --git a/lib/bb/__init__.py b/lib/bb/__init__.py
index 07a7f42b7..1188145f5 100644
--- a/lib/bb/__init__.py
+++ b/lib/bb/__init__.py
@@ -78,7 +78,15 @@ if sys.version_info[:3] < (2, 3, 0):
#projectdir = os.path.dirname(os.path.dirname(os.path.abspath(sys.argv[0])))
projectdir = os.getcwd()
-env = {}
+
+debug_level = 0
+
+if "BBDEBUG" in os.environ:
+ level = int(os.environ["BBDEBUG"])
+ if level:
+ debug_level = level
+ else:
+ debug_level = 0
class VarExpandError(Exception):
pass
@@ -101,7 +109,7 @@ debug_prepend = ''
def debug(lvl, *args):
- if 'BBDEBUG' in env and (env['BBDEBUG'] >= str(lvl)):
+ if debug_level >= lvl:
print debug_prepend + 'DEBUG:', ''.join(args)
def note(*args):