summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPaul Eggleton <paul.eggleton@linux.intel.com>2012-12-05 13:12:19 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2012-12-05 15:26:41 +0000
commit3e47343675fbdc49a6e39c393e14041294772cdd (patch)
treeb527641bad7f50e8ef8d3c3fb238c6768de810d4
parent40b4bb068faf38bc3e00be797a7a669bacd10008 (diff)
downloadpoky-3e47343675fbdc49a6e39c393e14041294772cdd.tar.gz
meta/lib/oe/sstatesig: fix locating stamp files
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. (From OE-Core rev: 82412ebabb0f89c694327ae38f7e864ee8511e7f) Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r--meta/lib/oe/sstatesig.py42
1 files changed, 23 insertions, 19 deletions
diff --git a/meta/lib/oe/sstatesig.py b/meta/lib/oe/sstatesig.py
index 39f9ccf77e..79a410eecb 100644
--- a/meta/lib/oe/sstatesig.py
+++ b/meta/lib/oe/sstatesig.py
@@ -80,6 +80,7 @@ def find_siginfo(pn, taskname, taskhashlist, d):
80 """ Find signature data files for comparison purposes """ 80 """ Find signature data files for comparison purposes """
81 81
82 import fnmatch 82 import fnmatch
83 import glob
83 84
84 if taskhashlist: 85 if taskhashlist:
85 hashfiles = {} 86 hashfiles = {}
@@ -93,27 +94,30 @@ def find_siginfo(pn, taskname, taskhashlist, d):
93 if key.startswith('virtual:native:'): 94 if key.startswith('virtual:native:'):
94 pn = pn + '-native' 95 pn = pn + '-native'
95 96
96 # First search in stamps dir
97 stampdir = d.getVar('TMPDIR', True) + '/stamps'
98 filespec = '%s-*.%s.sigdata.*' % (pn, taskname)
99 filedates = {} 97 filedates = {}
98
99 # First search in stamps dir
100 localdata = d.createCopy()
101 localdata.setVar('MULTIMACH_TARGET_SYS', '*')
102 localdata.setVar('PN', pn)
103 localdata.setVar('PV', '*')
104 localdata.setVar('PR', '*')
105 localdata.setVar('EXTENDPE', '')
106 stamp = localdata.getVar('STAMP', True)
107 filespec = '%s.%s.sigdata.*' % (stamp, taskname)
100 foundall = False 108 foundall = False
101 for root, dirs, files in os.walk(stampdir): 109 import glob
102 for fn in files: 110 for fullpath in glob.glob(filespec):
103 if fnmatch.fnmatch(fn, filespec): 111 match = False
104 fullpath = os.path.join(root, fn) 112 if taskhashlist:
105 match = False 113 for taskhash in taskhashlist:
106 if taskhashlist: 114 if fullpath.endswith('.%s' % taskhash):
107 for taskhash in taskhashlist: 115 hashfiles[taskhash] = fullpath
108 if fn.endswith('.%s' % taskhash): 116 if len(hashfiles) == len(taskhashlist):
109 hashfiles[taskhash] = fullpath 117 foundall = True
110 if len(hashfiles) == len(taskhashlist): 118 break
111 foundall = True 119 else:
112 break 120 filedates[fullpath] = os.stat(fullpath).st_mtime
113 else:
114 filedates[fullpath] = os.stat(fullpath).st_mtime
115 if foundall:
116 break
117 121
118 if len(filedates) < 2 and not foundall: 122 if len(filedates) < 2 and not foundall:
119 # That didn't work, look in sstate-cache 123 # That didn't work, look in sstate-cache