bitbake-dev: Sync with changes upstream

Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
This commit is contained in:
Richard Purdie 2009-10-17 20:11:27 +01:00
parent f1216d2adb
commit 627d9b1bde
9 changed files with 57 additions and 22 deletions

View File

@ -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
#============================================================================#

View File

@ -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

View File

@ -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)

View File

@ -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"""

View File

@ -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)

View File

@ -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)

View File

@ -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)

View File

@ -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]

View File

@ -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: