setattr( self, key, val )
+def print_exception(exc, value, tb):
+ """
+ Print the exception to stderr, only showing the traceback if bitbake
+ debugging is enabled.
+ """
+ if not bb.msg.debug_level['default']:
+ tb = None
+
+ sys.__excepthook__(exc, value, tb)
+
+
#============================================================================#
# main
#============================================================================#
for f,old_mtime in depends:
fmtime = bb.parse.cached_mtime_noerror(f)
# Check if file still exists
- if fmtime == 0:
+ if old_mtime != 0 and fmtime == 0:
self.remove(fn)
return False
\r
# Default daemon parameters.\r
# File mode creation mask of the daemon.\r
-UMASK = 0\r
+# For BitBake's children, we do want to inherit the parent umask.\r
+UMASK = None\r
\r
# Default maximum for the number of available file descriptors.\r
MAXFD = 1024\r
if (pid == 0): # The second child.\r
# We probably don't want the file mode creation mask inherited from\r
# the parent, so we give the child complete control over permissions.\r
- os.umask(UMASK)\r
+ if UMASK is not None:\r
+ os.umask(UMASK)\r
else:\r
# Parent (the first child) of the second child.\r
os._exit(0)\r
class ConfigParsed(Event):
"""Configuration Parsing Complete"""
+class RecipeParsed(Event):
+ """ Recipe Parsing Complete """
+
+ def __init__(self, fn, d):
+ self.fn = fn
+ Event.__init__(self, d)
+
class StampUpdate(Event):
"""Trigger for any adjustment of the stamp files to happen"""
if pn:
src_tarball_stash = (data.getVar('SRC_TARBALL_STASH_%s' % pn, d, True) or data.getVar('CVS_TARBALL_STASH_%s' % pn, d, True) or data.getVar('SRC_TARBALL_STASH', d, True) or data.getVar('CVS_TARBALL_STASH', d, True) or "").split()
+ ld = d.createCopy()
for stash in src_tarball_stash:
- fetchcmd = data.getVar("FETCHCOMMAND_mirror", d, True) or data.getVar("FETCHCOMMAND_wget", d, True)
- uri = stash + tarfn
- bb.msg.note(1, bb.msg.domain.Fetcher, "fetch " + uri)
- fetchcmd = fetchcmd.replace("${URI}", uri)
- httpproxy = data.getVar("http_proxy", d, True)
- ftpproxy = data.getVar("ftp_proxy", d, True)
- if httpproxy:
- fetchcmd = "http_proxy=" + httpproxy + " " + fetchcmd
- if ftpproxy:
- fetchcmd = "ftp_proxy=" + ftpproxy + " " + fetchcmd
- ret = os.system(fetchcmd)
- if ret == 0:
- bb.msg.note(1, bb.msg.domain.Fetcher, "Fetched %s from tarball stash, skipping checkout" % tarfn)
+ url = stash + tarfn
+ try:
+ ud = FetchData(url, ld)
+ except bb.fetch.NoMethodError:
+ bb.msg.debug(1, bb.msg.domain.Fetcher, "No method for %s" % url)
+ continue
+
+ ud.setup_localpath(ld)
+
+ try:
+ ud.method.go(url, ud, ld)
return True
+ except (bb.fetch.MissingParameterError,
+ bb.fetch.FetchError,
+ bb.fetch.MD5SumError):
+ import sys
+ (type, value, traceback) = sys.exc_info()
+ bb.msg.debug(2, bb.msg.domain.Fetcher, "Tarball stash fetch failure: %s" % value)
return False
try_mirror = staticmethod(try_mirror)
tasklist = data.getVar('__BBTASKS', d) or []
bb.build.add_tasks(tasklist, d)
+ bb.event.fire(bb.event.RecipeParsed(fn, d))
+
def handle(fn, d, include = 0):
global __func_start_regexp__, __inherit_regexp__, __export_func_regexp__, __addtask_regexp__, __addhandler_regexp__, __infunc__, __body__, __residue__
f = open(fn,'r')
abs_fn = fn
- if ext != ".bbclass":
- dname = os.path.dirname(abs_fn)
- if dname not in bbpath:
- bbpath.insert(0, dname)
- data.setVar('BBPATH', ":".join(bbpath), d)
-
if include:
bb.parse.mark_dependency(d, abs_fn)
fn = bb.data.expand(fn, data)
oldfn = bb.data.expand(oldfn, data)
+ if not os.path.isabs(fn):
+ dname = os.path.dirname(oldfn)
+ bbpath = "%s:%s" % (dname, bb.data.getVar("BBPATH", data, 1))
+ abs_fn = bb.which(bbpath, fn)
+ if abs_fn:
+ fn = abs_fn
+
from bb.parse import handle
try:
ret = handle(fn, data, True)
self.build( params, "configure" )
configure.usage = "<providee>"
+ def install( self, params ):
+ """Execute 'install' on a providee"""
+ self.build( params, "install" )
+ install.usage = "<providee>"
+
def edit( self, params ):
"""Call $EDITOR on a providee"""
name = params[0]
continue
if event[0].startswith('bb.event.ConfigParsed'):
continue
+ if event[0].startswith('bb.event.RecipeParsed'):
+ continue
print "Unknown Event: %s" % event
except KeyboardInterrupt: