]> code.ossystems Code Review - openembedded-core.git/commitdiff
bitbake: Sync various functions with those from bitbake-dev and bitbake upstream
authorRichard Purdie <rpurdie@linux.intel.com>
Tue, 3 Nov 2009 23:20:15 +0000 (23:20 +0000)
committerRichard Purdie <rpurdie@linux.intel.com>
Fri, 13 Nov 2009 12:15:21 +0000 (12:15 +0000)
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
bitbake/lib/bb/cache.py
bitbake/lib/bb/cooker.py
bitbake/lib/bb/event.py
bitbake/lib/bb/fetch/__init__.py
bitbake/lib/bb/parse/parse_py/BBHandler.py
bitbake/lib/bb/taskdata.py

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 b0692431bb7f8a61737c2130801cc2fef0f83c7a..230afcb4bcd0b14b3f3ecffa25d815976ccc3b09 100644 (file)
@@ -71,7 +71,7 @@ class BBCooker:
             self.configuration.cmd = bb.data.getVar("BB_DEFAULT_TASK", self.configuration.data) or "build"
 
         bbpkgs = bb.data.getVar('BBPKGS', self.configuration.data, True)
-        if bbpkgs:
+        if bbpkgs and len(self.configuration.pkgs_to_build) == 0:
             self.configuration.pkgs_to_build.extend(bbpkgs.split())
 
         #
index c0a59e612008ac05e730b87b4239c5c48516e208..9d7341f8784a0744b6ff70fbda7fc27edb3bcbda 100644 (file)
@@ -127,6 +127,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 03976d4d8c59aa5e7477969453988e83fffc739d..76b917ca5d108f029b71b32c653057f143243ebe 100644 (file)
@@ -88,7 +88,7 @@ def finalise(fn, d):
     from bb import build
     try:
         t = data.getVar('T', d)
-        data.setVar('T', '${TMPDIR}/', d)
+        data.setVar('T', '${TMPDIR}/anonfunc/', d)
         anonfuncs = data.getVar('__BBANONFUNCS', d) or []
         code = ""
         for f in anonfuncs:
@@ -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__
index 64ab032c3c8829c9f0517296a281c92a2df5d66d..45f6902dddbca34183fb1cbda27f9cfa84f42c8e 100644 (file)
@@ -374,11 +374,7 @@ class TaskData:
         all_p = dataCache.providers[item]
 
         eligible, foundUnique = bb.providers.filterProviders(all_p, item, cfgData, dataCache)
-
-        for p in eligible:
-            fnid = self.getfn_id(p)
-            if fnid in self.failed_fnids:
-                eligible.remove(p)
+        eligible = [p for p in eligible if not self.getfn_id(p) in self.failed_fnids]
 
         if not eligible:
             bb.msg.note(2, bb.msg.domain.Provider, "No buildable provider PROVIDES '%s' but '%s' DEPENDS on or otherwise requires it. Enable debugging and see earlier logs to find unbuildable providers." % (item, self.get_dependees_str(item)))
@@ -426,11 +422,7 @@ class TaskData:
             raise bb.providers.NoRProvider(item)
 
         eligible, numberPreferred = bb.providers.filterProvidersRunTime(all_p, item, cfgData, dataCache)
-
-        for p in eligible:
-            fnid = self.getfn_id(p)
-            if fnid in self.failed_fnids:
-                eligible.remove(p)
+        eligible = [p for p in eligible if not self.getfn_id(p) in self.failed_fnids]
 
         if not eligible:
             bb.msg.error(bb.msg.domain.Provider, "'%s' RDEPENDS/RRECOMMENDS or otherwise requires the runtime entity '%s' but it wasn't found in any PACKAGE or RPROVIDES variables of any buildable targets.\nEnable debugging and see earlier logs to find unbuildable targets." % (self.get_rdependees_str(item), item))