]> code.ossystems Code Review - openembedded-core.git/commitdiff
bitbake-dev: Sync with changes upstream
authorRichard Purdie <rpurdie@linux.intel.com>
Sat, 17 Oct 2009 19:11:27 +0000 (20:11 +0100)
committerRichard Purdie <rpurdie@linux.intel.com>
Sat, 17 Oct 2009 19:11:27 +0000 (20:11 +0100)
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
bitbake-dev/bin/bitbake
bitbake-dev/lib/bb/cache.py
bitbake-dev/lib/bb/daemonize.py
bitbake-dev/lib/bb/event.py
bitbake-dev/lib/bb/fetch/__init__.py
bitbake-dev/lib/bb/parse/parse_py/BBHandler.py
bitbake-dev/lib/bb/parse/parse_py/ConfHandler.py
bitbake-dev/lib/bb/shell.py
bitbake-dev/lib/bb/ui/knotty.py

index d9aa910422d3e303795639a0fff8da23f34df9d3..34c49b8c58021ffb4693853d037c14ae95d5810f 100755 (executable)
@@ -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
 #============================================================================#
index e91967c03284b40faca79dd799955b8b0fd925de..d30d57d33b8a86945fa1ca7d43a3f8995c0cadd4 100644 (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
 
index 6023c9ccd23a490d2620f150cc7e50e160cd1e61..1a8bb379f4be53b2216f1f3eee5b89089ae6886f 100644 (file)
@@ -29,7 +29,8 @@ import sys              # System-specific parameters and functions.
 \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
@@ -107,7 +108,8 @@ def createDaemon(function, logfile):
       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
index 8f0a1961df5159eac69ae04d50a0a920dfaca5e7..86b566febf798264c096208881adc9cce2402388 100644 (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"""
 
index 2191c284e3d23a1cc2ecfa588e92ae29271a9f2e..429822bfa986c4008d6b423bad4d4036701b8ab2 100644 (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)
 
index f13bb015baf9db7a7f6e6a66bbdda60071c3c7ee..76b917ca5d108f029b71b32c653057f143243ebe 100644 (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)
 
index f8a49689e2f7119f3b8ae2f41ad5d6e0734683f5..c9f1ea13fb7d99b23a260e366d5238a4272453cf 100644 (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)
index 2ab855b6449e8df1384570ba1d6b2f245710ea7b..66e51719a48159717169281caf471289b1c3ab94 100644 (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]
index 031fa715787607e4385c24075f8d9259dd26b1a0..8a2afeeb6da2912c80c03778371d617342e347ba 100644 (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: