Openembedded Core Discussions
 help / color / mirror / Atom feed
* [PATCH] meta/lib/oe/sstatesig: fix locating stamp files
@ 2012-12-05 13:12 Paul Eggleton
  0 siblings, 0 replies; only message in thread
From: Paul Eggleton @ 2012-12-05 13:12 UTC (permalink / raw)
  To: openembedded-core

Fixes "bitbake-diffsigs -t" for changes to the stamp directory layout,
and this time uses the actual value of STAMP to get the location of
sigdata files in the stamp directory rather than trying to do it
manually, which should be a little more robust.

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
---
 meta/lib/oe/sstatesig.py |   42 +++++++++++++++++++++++-------------------
 1 file changed, 23 insertions(+), 19 deletions(-)

diff --git a/meta/lib/oe/sstatesig.py b/meta/lib/oe/sstatesig.py
index 39f9ccf..79a410e 100644
--- a/meta/lib/oe/sstatesig.py
+++ b/meta/lib/oe/sstatesig.py
@@ -80,6 +80,7 @@ def find_siginfo(pn, taskname, taskhashlist, d):
     """ Find signature data files for comparison purposes """
 
     import fnmatch
+    import glob
 
     if taskhashlist:
         hashfiles = {}
@@ -93,27 +94,30 @@ def find_siginfo(pn, taskname, taskhashlist, d):
         if key.startswith('virtual:native:'):
             pn = pn + '-native'
 
-    # First search in stamps dir
-    stampdir = d.getVar('TMPDIR', True) + '/stamps'
-    filespec = '%s-*.%s.sigdata.*' % (pn, taskname)
     filedates = {}
+
+    # First search in stamps dir
+    localdata = d.createCopy()
+    localdata.setVar('MULTIMACH_TARGET_SYS', '*')
+    localdata.setVar('PN', pn)
+    localdata.setVar('PV', '*')
+    localdata.setVar('PR', '*')
+    localdata.setVar('EXTENDPE', '')
+    stamp = localdata.getVar('STAMP', True)
+    filespec = '%s.%s.sigdata.*' % (stamp, taskname)
     foundall = False
-    for root, dirs, files in os.walk(stampdir):
-        for fn in files:
-            if fnmatch.fnmatch(fn, filespec):
-                fullpath = os.path.join(root, fn)
-                match = False
-                if taskhashlist:
-                    for taskhash in taskhashlist:
-                        if fn.endswith('.%s' % taskhash):
-                            hashfiles[taskhash] = fullpath
-                            if len(hashfiles) == len(taskhashlist):
-                                foundall = True
-                                break
-                else:
-                    filedates[fullpath] = os.stat(fullpath).st_mtime
-        if foundall:
-            break
+    import glob
+    for fullpath in glob.glob(filespec):
+	match = False
+	if taskhashlist:
+	    for taskhash in taskhashlist:
+		if fullpath.endswith('.%s' % taskhash):
+		    hashfiles[taskhash] = fullpath
+		    if len(hashfiles) == len(taskhashlist):
+			foundall = True
+			break
+	else:
+	    filedates[fullpath] = os.stat(fullpath).st_mtime
 
     if len(filedates) < 2 and not foundall:
         # That didn't work, look in sstate-cache
-- 
1.7.10.4




^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2012-12-05 13:26 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-12-05 13:12 [PATCH] meta/lib/oe/sstatesig: fix locating stamp files Paul Eggleton

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox