]> git.ipfire.org Git - thirdparty/openembedded/openembedded-core-contrib.git/commitdiff
meta/lib/oe/sstatesig: fix finding siginfo across sstate and stamps
authorPaul Eggleton <paul.eggleton@linux.intel.com>
Fri, 4 Oct 2013 10:55:45 +0000 (11:55 +0100)
committerPaul Eggleton <paul.eggleton@linux.intel.com>
Fri, 4 Oct 2013 16:46:53 +0000 (17:46 +0100)
Enable comparisons with bitbake-diffsigs -t between a task whose output
exists in sstate and a recently executed version of the same task, as
well as produce the correct error message if only one signature is found
in the stamps directory (not enough for a comparison but enough to tell
the user that they at least got the task/recipe name correct.)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
meta/lib/oe/sstatesig.py

index 852fb7e64ac7e0490bbead0b1dfe151964900d03..3ea0bfdb120bdde0f62b49473f00ba7fc2147571 100644 (file)
@@ -106,6 +106,7 @@ def find_siginfo(pn, taskname, taskhashlist, d):
     stamp = localdata.getVar('STAMP', True)
     filespec = '%s.%s.sigdata.*' % (stamp, taskname)
     foundall = False
+    skipsigs = []
     import glob
     for fullpath in glob.glob(filespec):
         match = False
@@ -118,6 +119,7 @@ def find_siginfo(pn, taskname, taskhashlist, d):
                         break
         else:
             filedates[fullpath] = os.stat(fullpath).st_mtime
+            skipsigs.append(fullpath.rsplit('.', 1)[-1])
 
     if len(filedates) < 2 and not foundall:
         # That didn't work, look in sstate-cache
@@ -137,21 +139,31 @@ def find_siginfo(pn, taskname, taskhashlist, d):
             if not sstatename:
                 sstatename = taskname
             filespec = '%s_%s.*.siginfo' % (localdata.getVar('SSTATE_PKG', True), sstatename)
+            # We want to ignore any sstate siginfo files with the same signature as we've already found in the stamps
+            skipfilespecs = []
+            for skiphash in skipsigs:
+                localdata.setVar('BB_TASKHASH', skiphash)
+                skipfilespecs.append('%s_%s.*.siginfo' % (localdata.getVar('SSTATE_PKG', True), sstatename))
 
             if hashval != '*':
                 sstatedir = "%s/%s" % (d.getVar('SSTATE_DIR', True), hashval[:2])
             else:
                 sstatedir = d.getVar('SSTATE_DIR', True)
 
-            filedates = {}
             for root, dirs, files in os.walk(sstatedir):
                 for fn in files:
                     fullpath = os.path.join(root, fn)
                     if fnmatch.fnmatch(fullpath, filespec):
-                        if taskhashlist:
-                            hashfiles[hashval] = fullpath
-                        else:
-                            filedates[fullpath] = os.stat(fullpath).st_mtime
+                        skip = False
+                        for skipfilespec in skipfilespecs:
+                            if fnmatch.fnmatch(fullpath, skipfilespec):
+                                skip = True
+                                break
+                        if not skip:
+                            if taskhashlist:
+                                hashfiles[hashval] = fullpath
+                            else:
+                                filedates[fullpath] = os.stat(fullpath).st_mtime
 
     if taskhashlist:
         return hashfiles