[oe-commits] [openembedded-core] 05/20: sstatesig.py: Add a method to "unlock" recipes

git at git.openembedded.org git at git.openembedded.org
Fri Apr 8 07:05:59 UTC 2016


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

commit 8a8fc54d824767a6a94d12a4ace98b0bdbb1aa25
Author: Randy Witt <randy.e.witt at linux.intel.com>
AuthorDate: Thu Apr 7 16:34:52 2016 -0700

    sstatesig.py: Add a method to "unlock" recipes
    
    In order to support workflows using devtool where a user might want to
    modify tasks that exist in locked-sigs.inc, there must be a way to unlock
    recipes.
    
    This patch adds that support by allowing the user to add recipes to
    SIGGEN_UNLOCKED_RECIPES. Recipes that exist in that variable will have
    all their tasks unlocked, as well as any tasks that depend on that
    recipe.
    
    For example if foo->bar->baz, if you unlock baz, it will also unlock bar
    so that foo can be rebuilt without explicitly specifying bar as being
    unlocked.
    
    [YOCTO #9195]
    
    Signed-off-by: Randy Witt <randy.e.witt at linux.intel.com>
    Signed-off-by: Richard Purdie <richard.purdie at linuxfoundation.org>
---
 meta/lib/oe/sstatesig.py | 24 +++++++++++++++++++++++-
 1 file changed, 23 insertions(+), 1 deletion(-)

diff --git a/meta/lib/oe/sstatesig.py b/meta/lib/oe/sstatesig.py
index 009adea..01dce66 100644
--- a/meta/lib/oe/sstatesig.py
+++ b/meta/lib/oe/sstatesig.py
@@ -94,6 +94,9 @@ class SignatureGeneratorOEBasicHash(bb.siggen.SignatureGeneratorBasicHash):
         self.lockedhashfn = {}
         self.machine = data.getVar("MACHINE", True)
         self.mismatch_msgs = []
+        self.unlockedrecipes = (data.getVar("SIGGEN_UNLOCKED_RECIPES", True) or
+                                "").split()
+        self.unlockedrecipes = { k: "" for k in self.unlockedrecipes }
         pass
 
     def tasks_resolved(self, virtmap, virtpnmap, dataCache):
@@ -136,7 +139,26 @@ class SignatureGeneratorOEBasicHash(bb.siggen.SignatureGeneratorBasicHash):
         recipename = dataCache.pkg_fn[fn]
         self.lockedpnmap[fn] = recipename
         self.lockedhashfn[fn] = dataCache.hashfn[fn]
-        if recipename in self.lockedsigs:
+
+        unlocked = False
+        if recipename in self.unlockedrecipes:
+            unlocked = True
+        else:
+            def recipename_from_dep(dep):
+                # The dep entry will look something like
+                # /path/path/recipename.bb.task, virtual:native:/p/foo.bb.task,
+                # ...
+                fn = dep.rsplit('.', 1)[0]
+                return dataCache.pkg_fn[fn]
+
+            # If any unlocked recipe is in the direct dependencies then the
+            # current recipe should be unlocked as well.
+            depnames = [ recipename_from_dep(x) for x in deps ]
+            if any(x in y for y in depnames for x in self.unlockedrecipes):
+                self.unlockedrecipes[recipename] = ''
+                unlocked = True
+
+        if not unlocked and recipename in self.lockedsigs:
             if task in self.lockedsigs[recipename]:
                 k = fn + "." + task
                 h_locked = self.lockedsigs[recipename][task][0]

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


More information about the Openembedded-commits mailing list