summaryrefslogtreecommitdiffstats
path: root/bitbake/lib/bb/__init__.py
diff options
context:
space:
mode:
Diffstat (limited to 'bitbake/lib/bb/__init__.py')
-rw-r--r--bitbake/lib/bb/__init__.py27
1 files changed, 11 insertions, 16 deletions
diff --git a/bitbake/lib/bb/__init__.py b/bitbake/lib/bb/__init__.py
index c3e7a16658..61eb5f3db8 100644
--- a/bitbake/lib/bb/__init__.py
+++ b/bitbake/lib/bb/__init__.py
@@ -23,7 +23,7 @@ this program; if not, write to the Free Software Foundation, Inc., 59 Temple
23Place, Suite 330, Boston, MA 02111-1307 USA. 23Place, Suite 330, Boston, MA 02111-1307 USA.
24""" 24"""
25 25
26__version__ = "1.4.3" 26__version__ = "1.7.4"
27 27
28__all__ = [ 28__all__ = [
29 29
@@ -63,24 +63,24 @@ __all__ = [
63 "manifest", 63 "manifest",
64 "methodpool", 64 "methodpool",
65 "cache", 65 "cache",
66 "runqueue",
67 "taskdata",
68 "providers",
66 ] 69 ]
67 70
68whitespace = '\t\n\x0b\x0c\r ' 71whitespace = '\t\n\x0b\x0c\r '
69lowercase = 'abcdefghijklmnopqrstuvwxyz' 72lowercase = 'abcdefghijklmnopqrstuvwxyz'
70 73
71import sys, os, types, re, string 74import sys, os, types, re, string, bb
75from bb import msg
72 76
73#projectdir = os.path.dirname(os.path.dirname(os.path.abspath(sys.argv[0]))) 77#projectdir = os.path.dirname(os.path.dirname(os.path.abspath(sys.argv[0])))
74projectdir = os.getcwd() 78projectdir = os.getcwd()
75 79
76debug_level = 0
77
78if "BBDEBUG" in os.environ: 80if "BBDEBUG" in os.environ:
79 level = int(os.environ["BBDEBUG"]) 81 level = int(os.environ["BBDEBUG"])
80 if level: 82 if level:
81 debug_level = level 83 bb.msg.set_debug_level(level)
82 else:
83 debug_level = 0
84 84
85class VarExpandError(Exception): 85class VarExpandError(Exception):
86 pass 86 pass
@@ -99,22 +99,17 @@ class MalformedUrl(Exception):
99####################################################################### 99#######################################################################
100####################################################################### 100#######################################################################
101 101
102debug_prepend = ''
103
104
105def debug(lvl, *args): 102def debug(lvl, *args):
106 if debug_level >= lvl: 103 bb.msg.std_debug(lvl, ''.join(args))
107 print debug_prepend + 'DEBUG:', ''.join(args)
108 104
109def note(*args): 105def note(*args):
110 print debug_prepend + 'NOTE:', ''.join(args) 106 bb.msg.std_note(''.join(args))
111 107
112def error(*args): 108def error(*args):
113 print debug_prepend + 'ERROR:', ''.join(args) 109 bb.msg.std_error(''.join(args))
114 110
115def fatal(*args): 111def fatal(*args):
116 print debug_prepend + 'ERROR:', ''.join(args) 112 bb.msg.std_fatal(''.join(args))
117 sys.exit(1)
118 113
119 114
120####################################################################### 115#######################################################################