diff options
author | Paul Eggleton <paul.eggleton@linux.intel.com> | 2017-04-07 10:01:43 +1200 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2017-04-10 23:00:44 +0100 |
commit | 27b7de94f0602143a9408dc36c636d301258158b (patch) | |
tree | d64ccfe77cebaccff071d64af4a901e6a9cfe955 | |
parent | e340af0449db5794096f2abb966c9ba314f88452 (diff) | |
download | poky-27b7de94f0602143a9408dc36c636d301258158b.tar.gz |
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>
-rw-r--r-- | meta/lib/oe/sstatesig.py | 25 |
1 files changed, 9 insertions, 16 deletions
diff --git a/meta/lib/oe/sstatesig.py b/meta/lib/oe/sstatesig.py index 13fd3bd633..a76a031ba2 100644 --- a/meta/lib/oe/sstatesig.py +++ b/meta/lib/oe/sstatesig.py | |||
@@ -318,22 +318,15 @@ def find_siginfo(pn, taskname, taskhashlist, d): | |||
318 | sstatename = taskname[3:] | 318 | sstatename = taskname[3:] |
319 | filespec = '%s_%s.*.siginfo' % (localdata.getVar('SSTATE_PKG'), sstatename) | 319 | filespec = '%s_%s.*.siginfo' % (localdata.getVar('SSTATE_PKG'), sstatename) |
320 | 320 | ||
321 | if hashval != '*': | 321 | matchedfiles = glob.glob(filespec) |
322 | sstatedir = "%s/%s" % (d.getVar('SSTATE_DIR'), hashval[:2]) | 322 | for fullpath in matchedfiles: |
323 | else: | 323 | if taskhashlist: |
324 | sstatedir = d.getVar('SSTATE_DIR') | 324 | hashfiles[hashval] = fullpath |
325 | 325 | else: | |
326 | for root, dirs, files in os.walk(sstatedir): | 326 | try: |
327 | for fn in files: | 327 | filedates[fullpath] = os.stat(fullpath).st_mtime |
328 | fullpath = os.path.join(root, fn) | 328 | except: |
329 | if fnmatch.fnmatch(fullpath, filespec): | 329 | continue |
330 | if taskhashlist: | ||
331 | hashfiles[hashval] = fullpath | ||
332 | else: | ||
333 | try: | ||
334 | filedates[fullpath] = os.stat(fullpath).st_mtime | ||
335 | except: | ||
336 | continue | ||
337 | 330 | ||
338 | if taskhashlist: | 331 | if taskhashlist: |
339 | return hashfiles | 332 | return hashfiles |