diff options
author | Paul Eggleton <paul.eggleton@linux.intel.com> | 2013-10-04 11:55:45 +0100 |
---|---|---|
committer | Paul Eggleton <paul.eggleton@linux.intel.com> | 2013-10-04 17:46:53 +0100 |
commit | c0924452292049f1063ba8607af9093403565313 (patch) | |
tree | 6336f6c6f41f153d3f21bc3d4a7079d20bcfbb8c /meta/lib/oe | |
parent | c0a8c5c07e0dd6f0ae302e9a4dcf7973e73e68e1 (diff) | |
download | openembedded-core-contrib-c0924452292049f1063ba8607af9093403565313.tar.gz |
meta/lib/oe/sstatesig: fix finding siginfo across sstate and stamps
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>
Diffstat (limited to 'meta/lib/oe')
-rw-r--r-- | meta/lib/oe/sstatesig.py | 22 |
1 files changed, 17 insertions, 5 deletions
diff --git a/meta/lib/oe/sstatesig.py b/meta/lib/oe/sstatesig.py index 852fb7e64a..3ea0bfdb12 100644 --- a/meta/lib/oe/sstatesig.py +++ b/meta/lib/oe/sstatesig.py @@ -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 |