[oe-commits] [openembedded-core] 34/39: lib/oe/sstatesig: fix finding native siginfo files in sstate-cache

git at git.openembedded.org git at git.openembedded.org
Thu Apr 6 23:52:14 UTC 2017


This is an automated email from the git hooks/post-receive script.

rpurdie pushed a commit to branch master-next
in repository openembedded-core.

commit d8fa63694a0a996fc5cdcf5c645d1f11b930362b
Author: Paul Eggleton <paul.eggleton at linux.intel.com>
AuthorDate: Fri Apr 7 10:01:43 2017 +1200

    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.
    
    Signed-off-by: Paul Eggleton <paul.eggleton at linux.intel.com>
    Signed-off-by: Richard Purdie <richard.purdie at linuxfoundation.org>
---
 meta/lib/oe/sstatesig.py | 25 +++++++++----------------
 1 file changed, 9 insertions(+), 16 deletions(-)

diff --git a/meta/lib/oe/sstatesig.py b/meta/lib/oe/sstatesig.py
index 13fd3bd..a76a031 100644
--- a/meta/lib/oe/sstatesig.py
+++ b/meta/lib/oe/sstatesig.py
@@ -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

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the Openembedded-commits mailing list