summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xbitbake-dev/bin/bitbake11
-rw-r--r--bitbake-dev/lib/bb/cache.py2
-rw-r--r--bitbake-dev/lib/bb/daemonize.py6
-rw-r--r--bitbake-dev/lib/bb/event.py7
-rw-r--r--bitbake-dev/lib/bb/fetch/__init__.py31
-rw-r--r--bitbake-dev/lib/bb/parse/parse_py/BBHandler.py8
-rw-r--r--bitbake-dev/lib/bb/parse/parse_py/ConfHandler.py7
-rw-r--r--bitbake-dev/lib/bb/shell.py5
-rw-r--r--bitbake-dev/lib/bb/ui/knotty.py2
9 files changed, 57 insertions, 22 deletions
diff --git a/bitbake-dev/bin/bitbake b/bitbake-dev/bin/bitbake
index d9aa91042..34c49b8c5 100755
--- a/bitbake-dev/bin/bitbake
+++ b/bitbake-dev/bin/bitbake
@@ -48,6 +48,17 @@ class BBConfiguration( object ):
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
#============================================================================#
diff --git a/bitbake-dev/lib/bb/cache.py b/bitbake-dev/lib/bb/cache.py
index e91967c03..d30d57d33 100644
--- a/bitbake-dev/lib/bb/cache.py
+++ b/bitbake-dev/lib/bb/cache.py
@@ -273,7 +273,7 @@ class Cache:
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
diff --git a/bitbake-dev/lib/bb/daemonize.py b/bitbake-dev/lib/bb/daemonize.py
index 6023c9ccd..1a8bb379f 100644
--- a/bitbake-dev/lib/bb/daemonize.py
+++ b/bitbake-dev/lib/bb/daemonize.py
@@ -29,7 +29,8 @@ import sys # System-specific parameters and functions.
# Default daemon parameters.
# File mode creation mask of the daemon.
-UMASK = 0
+# For BitBake's children, we do want to inherit the parent umask.
+UMASK = None
# Default maximum for the number of available file descriptors.
MAXFD = 1024
@@ -107,7 +108,8 @@ def createDaemon(function, logfile):
if (pid == 0): # The second child.
# We probably don't want the file mode creation mask inherited from
# the parent, so we give the child complete control over permissions.
- os.umask(UMASK)
+ if UMASK is not None:
+ os.umask(UMASK)
else:
# Parent (the first child) of the second child.
os._exit(0)
diff --git a/bitbake-dev/lib/bb/event.py b/bitbake-dev/lib/bb/event.py
index 8f0a1961d..86b566feb 100644
--- a/bitbake-dev/lib/bb/event.py
+++ b/bitbake-dev/lib/bb/event.py
@@ -125,6 +125,13 @@ def getName(e):
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"""
diff --git a/bitbake-dev/lib/bb/fetch/__init__.py b/bitbake-dev/lib/bb/fetch/__init__.py
index 2191c284e..429822bfa 100644
--- a/bitbake-dev/lib/bb/fetch/__init__.py
+++ b/bitbake-dev/lib/bb/fetch/__init__.py
@@ -485,21 +485,26 @@ class Fetch(object):
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)
diff --git a/bitbake-dev/lib/bb/parse/parse_py/BBHandler.py b/bitbake-dev/lib/bb/parse/parse_py/BBHandler.py
index f13bb015b..76b917ca5 100644
--- a/bitbake-dev/lib/bb/parse/parse_py/BBHandler.py
+++ b/bitbake-dev/lib/bb/parse/parse_py/BBHandler.py
@@ -114,6 +114,8 @@ def finalise(fn, d):
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__
@@ -160,12 +162,6 @@ def handle(fn, d, include = 0):
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)
diff --git a/bitbake-dev/lib/bb/parse/parse_py/ConfHandler.py b/bitbake-dev/lib/bb/parse/parse_py/ConfHandler.py
index f8a49689e..c9f1ea13f 100644
--- a/bitbake-dev/lib/bb/parse/parse_py/ConfHandler.py
+++ b/bitbake-dev/lib/bb/parse/parse_py/ConfHandler.py
@@ -102,6 +102,13 @@ def include(oldfn, fn, data, error_out):
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)
diff --git a/bitbake-dev/lib/bb/shell.py b/bitbake-dev/lib/bb/shell.py
index 2ab855b64..66e51719a 100644
--- a/bitbake-dev/lib/bb/shell.py
+++ b/bitbake-dev/lib/bb/shell.py
@@ -204,6 +204,11 @@ class BitBakeShellCommands:
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]
diff --git a/bitbake-dev/lib/bb/ui/knotty.py b/bitbake-dev/lib/bb/ui/knotty.py
index 031fa7157..8a2afeeb6 100644
--- a/bitbake-dev/lib/bb/ui/knotty.py
+++ b/bitbake-dev/lib/bb/ui/knotty.py
@@ -143,6 +143,8 @@ def init(server, eventHandler):
continue
if event[0].startswith('bb.event.ConfigParsed'):
continue
+ if event[0].startswith('bb.event.RecipeParsed'):
+ continue
print "Unknown Event: %s" % event
except KeyboardInterrupt: