[oe-commits] Richard Purdie : sstatesig: Allow the BB_HASHFILENAME to be passed in for comparision purposes

git at git.openembedded.org git at git.openembedded.org
Thu Dec 19 09:43:17 UTC 2013


Module: openembedded-core.git
Branch: master-next
Commit: 8d7c9873eca204fc21404b26b3e0ae28ff5105b0
URL:    http://git.openembedded.org/?p=openembedded-core.git&a=commit;h=8d7c9873eca204fc21404b26b3e0ae28ff5105b0

Author: Richard Purdie <richard.purdie at linuxfoundation.org>
Date:   Thu Dec 19 09:39:04 2013 +0000

sstatesig: Allow the BB_HASHFILENAME to be passed in for comparision purposes

Currently the code can match too many things, for example, searching for
gcc-cross, we'd also get gcc-cross-initial.

If we have a bitbake cache available, we'd often have the BB_HASHFILENAME
data available from that cache. That can give us something to filter the
matches against.

The format of that field is metadata defined so it needs to be processed
in a metadata function (which find_siginfo is).

Signed-off-by: Richard Purdie <richard.purdie at linuxfoundation.org>

---

 meta/lib/oe/sstatesig.py | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/meta/lib/oe/sstatesig.py b/meta/lib/oe/sstatesig.py
index b13d11c..836a148 100644
--- a/meta/lib/oe/sstatesig.py
+++ b/meta/lib/oe/sstatesig.py
@@ -85,7 +85,7 @@ bb.siggen.SignatureGeneratorOEBasic = SignatureGeneratorOEBasic
 bb.siggen.SignatureGeneratorOEBasicHash = SignatureGeneratorOEBasicHash
 
 
-def find_siginfo(pn, taskname, taskhashlist, d):
+def find_siginfo(pn, taskname, taskhashlist, d, hashfn = None):
     """ Find signature data files for comparison purposes """
 
     import fnmatch
@@ -94,6 +94,10 @@ def find_siginfo(pn, taskname, taskhashlist, d):
     if taskhashlist:
         hashfiles = {}
 
+    # This is based on BB_HASHFILENAME set for the recipe and provided from the cache
+    if hashfn:
+         hashfn = hashfn.split(" ")[1]
+
     if not taskname:
         # We have to derive pn and taskname
         key = pn
@@ -157,6 +161,8 @@ def find_siginfo(pn, taskname, taskhashlist, d):
                 for fn in files:
                     fullpath = os.path.join(root, fn)
                     if fnmatch.fnmatch(fullpath, filespec):
+                        if hashfn and not os.path.basename(fullpath).startswith(hashfn):
+                            continue
                         if taskhashlist:
                             hashfiles[hashval] = fullpath
                         else:



More information about the Openembedded-commits mailing list