lib/oe/sstatesig: fix finding native siginfo files in sstate-cache

When comparing signatures with bitbake-diffsigs -t or bitbake -S
printdiff, we use this find_siginfo() function implemented in this
module to find the siginfo/sigdata files corresponding to the tasks
we're looking for. However, native sstate files go into a
NATIVELSBSTRING subdirectory and there was no handling for this when
asking about native recipes.

I'm not even sure why we were walking SSTATE_DIR in order to find
this - we don't need to, we just need to run glob.glob() on the filespec
we calculate, which should be a little bit more efficient.

(From OE-Core rev: 8cb472e4ed25e56ec0d9cf6d8d101d1ab6687a5b)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
Paul Eggleton 2017-04-07 10:01:43 +12:00 committed by Richard Purdie
parent e340af0449
commit 27b7de94f0
1 changed files with 9 additions and 16 deletions

View File

@ -318,22 +318,15 @@ def find_siginfo(pn, taskname, taskhashlist, d):
sstatename = taskname[3:]
filespec = '%s_%s.*.siginfo' % (localdata.getVar('SSTATE_PKG'), sstatename)
if hashval != '*':
sstatedir = "%s/%s" % (d.getVar('SSTATE_DIR'), hashval[:2])
else:
sstatedir = d.getVar('SSTATE_DIR')
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:
try:
filedates[fullpath] = os.stat(fullpath).st_mtime
except:
continue
matchedfiles = glob.glob(filespec)
for fullpath in matchedfiles:
if taskhashlist:
hashfiles[hashval] = fullpath
else:
try:
filedates[fullpath] = os.stat(fullpath).st_mtime
except:
continue
if taskhashlist:
return hashfiles