]> code.ossystems Code Review - openembedded-core.git/commitdiff
bitbake: Sync with upstream 1.8 branch for fixes
authorRichard Purdie <richard@openedhand.com>
Sun, 12 Aug 2007 23:06:49 +0000 (23:06 +0000)
committerRichard Purdie <richard@openedhand.com>
Sun, 12 Aug 2007 23:06:49 +0000 (23:06 +0000)
git-svn-id: https://svn.o-hand.com/repos/poky/trunk@2484 311d38ba-8fff-0310-9ca6-ca027cbcb966

bitbake/ChangeLog
bitbake/lib/bb/__init__.py
bitbake/lib/bb/cooker.py
bitbake/lib/bb/data.py
bitbake/lib/bb/fetch/__init__.py
bitbake/lib/bb/fetch/local.py

index c5641836d13d0aa717bb65ac0ff16625f912ec43..1fbbd710bb9a8712bc21a6a17127ad051bf7de24 100644 (file)
@@ -12,7 +12,14 @@ Changes in Bitbake 1.8.x:
        - Add pn-PN to overrides when evaluating PREFERRED_VERSION
        - Improve the progress indicator by skipping tasks that have 
          already run before starting the build rather than during it
-       - Add profiling option (-P)             
+       - Add profiling option (-P)
+       - Add BB_SRCREV_POLICY variable (clear or cache) to control SRCREV cache
+       - Add SRCREV_FORMAT support
+       - Fix local fetcher's localpath return values
+       - Apply OVERRIDES before performing immediate expansions
+       - Allow the -b -e option combination to take regular expressions
+       - Fix handling of variables with expansion in the name using _append/_prepend
+         e.g. RRECOMMENDS_${PN}_append_xyz = "abc"
 
 Changes in Bitbake 1.8.6:
        - Correctly redirect stdin when forking
index e601eda469d6868c012629620db3e349f9da83ef..1bfecc49eca065be9fa559cf8a5a69b4992eb710 100644 (file)
@@ -345,14 +345,20 @@ def encodeurl(decoded):
 #######################################################################
 
 def which(path, item, direction = 0):
-    """Useful function for locating a file in a PATH"""
-    found = ""
+    """
+    Locate a file in a PATH
+    """
+
+    paths = (path or "").split(':')
+    if direction != 0:
+        paths.reverse()
+
     for p in (path or "").split(':'):
-        if os.path.exists(os.path.join(p, item)):
-            found = os.path.join(p, item)
-            if direction == 0:
-                break
-    return found
+        next = os.path.join(p, item)
+        if os.path.exists(next):
+            return next
+
+    return ""
 
 #######################################################################
 
index 7db3529bb4875ccfc120ddd9f3b9c0a866f1e09d..955fbb434c81838ba61d1903286da765a95745f1 100644 (file)
@@ -143,10 +143,11 @@ class BBCooker:
         if self.configuration.buildfile:
             self.cb = None
             self.bb_cache = bb.cache.init(self)
+            bf = self.matchFile(self.configuration.buildfile)
             try:
-                self.configuration.data = self.bb_cache.loadDataFull(self.configuration.buildfile, self.configuration.data)
+                self.configuration.data = self.bb_cache.loadDataFull(bf, self.configuration.data)
             except IOError, e:
-                bb.msg.fatal(bb.msg.domain.Parsing, "Unable to read %s: %s" % ( self.configuration.buildfile, e ))
+                bb.msg.fatal(bb.msg.domain.Parsing, "Unable to read %s: %s" % (bf, e))
             except Exception, e:
                 bb.msg.fatal(bb.msg.domain.Parsing, "%s" % e)
         # emit variables and shell functions
@@ -377,14 +378,15 @@ class BBCooker:
             bb.data.setVar("BUILDNAME", os.popen('date +%Y%m%d%H%M').readline().strip(), self.configuration.data)
         bb.data.setVar("BUILDSTART", time.strftime('%m/%d/%Y %H:%M:%S',time.gmtime()),self.configuration.data)
 
-    def buildFile(self, buildfile):
+    def matchFile(self, buildfile):
         """
-        Build the file matching regexp buildfile
+        Convert the fragment buildfile into a real file
+        Error if there are too many matches
         """
-
         bf = os.path.abspath(buildfile)
         try:
             os.stat(bf)
+            return bf
         except OSError:
             (filelist, masked) = self.collect_bbfiles()
             regexp = re.compile(buildfile)
@@ -398,7 +400,14 @@ class BBCooker:
                 for f in matches:
                     bb.msg.error(bb.msg.domain.Parsing, "    %s" % f)
                 sys.exit(1)
-            bf = matches[0]                
+            return matches[0]              
+
+    def buildFile(self, buildfile):
+        """
+        Build the file matching regexp buildfile
+        """
+
+        bf = self.matchFile(buildfile)
 
         bbfile_data = bb.parse.handle(bf, self.configuration.data)
 
index 9782c9f546d85eaaaf4e9b591f49b3c357e8ba59..b2025f0694149d3b9a373c7877046c76ee1e5634 100644 (file)
@@ -288,6 +288,10 @@ def expandKeys(alterdata, readdata = None):
             src = getVarFlag(key, i, readdata) or []
             dest.extend(src)
             setVarFlag(ekey, i, dest, alterdata)
+            
+            if key in alterdata._special_values[i]:
+                alterdata._special_values[i].remove(key)
+                alterdata._special_values[i].add(ekey)
 
         delVar(key, alterdata)
 
index f739245bd10ac6dddaa1b01cb23221ecb925fe14..229b28c19d1829b2f7f3a4be8fc2333e7b0f6821 100644 (file)
@@ -182,8 +182,21 @@ def get_srcrev(d):
     if len(scms) == 1:
         return urldata[scms[0]].method.sortable_revision(scms[0], urldata[scms[0]], d)
 
-    bb.msg.error(bb.msg.domain.Fetcher, "Sorry, support for SRCREV_FORMAT still needs to be written")
-    raise ParameterError
+    #
+    # Mutiple SCMs are in SRC_URI so we resort to SRCREV_FORMAT
+    #
+    format = bb.data.getVar('SRCREV_FORMAT', d, 1)
+    if not format:
+        bb.msg.error(bb.msg.domain.Fetcher, "The SRCREV_FORMAT variable must be set when multiple SCMs are used.")
+        raise ParameterError
+
+    for scm in scms:
+        if 'name' in urldata[scm].parm:
+            name = urldata[scm].parm["name"]
+            rev = urldata[scm].method.sortable_revision(scm, urldata[scm], d)
+            format = format.replace(name, rev)
+
+    return format
 
 def localpath(url, d, cache = True):
     """
index 9be8f1ce4bd8b271757b5c5e8eca66ed32e3a0f7..5e480a208e0499acd94fc74c78d30366df75bef4 100644 (file)
@@ -38,9 +38,11 @@ class Local(Fetch):
         return urldata.type in ['file','patch']
 
     def localpath(self, url, urldata, d):
-        """Return the local filename of a given url assuming a successful fetch.
+        """
+        Return the local filename of a given url assuming a successful fetch.
         """
         path = url.split("://")[1]
+        path = path.split(";")[0]
         newpath = path
         if path[0] != "/":
             filespath = data.getVar('FILESPATH', d, 1)