[oe-commits] [bitbake] 20/20: bitbake: data: Ensure task checksums account for remove data

git at git.openembedded.org git at git.openembedded.org
Wed Oct 17 11:26:12 UTC 2018


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

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

commit 0a17952ff6d74a04778891a34f7796d52be5b215
Author: Richard Purdie <richard.purdie at linuxfoundation.org>
AuthorDate: Tue Oct 16 17:15:20 2018 +0100

    bitbake: data: Ensure task checksums account for remove data
    
    Currently remove operations are not being accounted for in the task
    checksums. This is a fairly serious oversight and needs to be fixed.
    
    To do so, we need internal data from getVarFlag combined with the
    expanded variable data so that only "active" remove operators are
    accounted for in the task checksum.
    
    This code adds in an internal hook to get the data and accounts
    for the operator in the task checksum when the removal is active.
    
    [YOCTO #12913]
    
    (Bitbake rev: 48eb92d9651f70b85f3684f3136a8c31a114254a)
    
    Signed-off-by: Richard Purdie <richard.purdie at linuxfoundation.org>
---
 lib/bb/data.py       | 13 +++++++++++++
 lib/bb/data_smart.py | 12 +++++++-----
 2 files changed, 20 insertions(+), 5 deletions(-)

diff --git a/lib/bb/data.py b/lib/bb/data.py
index e270007..017bfc5 100644
--- a/lib/bb/data.py
+++ b/lib/bb/data.py
@@ -307,6 +307,15 @@ def build_dependencies(key, keys, shelldeps, varflagsexcl, d):
                 return newvalue
             return value + newvalue
 
+        def handle_remove(value, deps, expandedval, removes, d):
+            for r in sorted(removes):
+                r2 = d.expandWithRefs(r, None)
+                if r2.value in expandedval.split():
+                    value += "\n_remove of %s(%s)" % (r, r2.value)
+                    deps |= r2.references
+                    deps = deps | (keys & r2.execs)
+            return value
+
         if "vardepvalue" in varflags:
             value = varflags.get("vardepvalue")
         elif varflags.get("func"):
@@ -327,6 +336,8 @@ def build_dependencies(key, keys, shelldeps, varflagsexcl, d):
                 deps = deps | parsedvar.references
                 deps = deps | (keys & parser.execs) | (keys & parsedvar.execs)
                 value = handle_contains(value, parsedvar.contains, d)
+                if hasattr(parsedvar, "removes"):
+                    value = handle_remove(value, deps, parsedvar.preremove, parsedvar.removes, d)
             if vardeps is None:
                 parser.log.flush()
             if "prefuncs" in varflags:
@@ -340,6 +351,8 @@ def build_dependencies(key, keys, shelldeps, varflagsexcl, d):
             deps |= parser.references
             deps = deps | (keys & parser.execs)
             value = handle_contains(value, parser.contains, d)
+            if hasattr(parser, "removes"):
+                value = handle_remove(value, deps, parser.preremove, parser.removes, d)
 
         if "vardepvalueexclude" in varflags:
             exclude = varflags.get("vardepvalueexclude")
diff --git a/lib/bb/data_smart.py b/lib/bb/data_smart.py
index 7127841..9bee0c3 100644
--- a/lib/bb/data_smart.py
+++ b/lib/bb/data_smart.py
@@ -815,12 +815,14 @@ class DataSmart(MutableMapping):
                 if match:
                     removes.extend(self.expand(r).split())
 
-            if removes:
+            if removes and parser:
+                parser.removes = removes
+                parser.preremove = parser.value
                 filtered = filter(lambda v: v not in removes,
-                                  __whitespace_split__.split(value))
-                value = "".join(filtered)
-                if parser:
-                    parser.value = value
+                                  __whitespace_split__.split(parser.value))
+                parser.value = "".join(filtered)
+                if expand:
+                    value = parser.value
 
         if parser:
             self.expand_cache[cachename] = parser

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


More information about the Openembedded-commits mailing list