[gnome-continuous-yocto/gnomeostree-3.28-rocko: 4175/8267] bitbake: data_smart: Fix unneeded variable manipulation



commit 45df694a9f472ac2f684aadac4d864c3dfdc48a7
Author: Richard Purdie <richard purdie linuxfoundation org>
Date:   Fri Jan 20 11:28:04 2017 +0000

    bitbake: data_smart: Fix unneeded variable manipulation
    
    If was pointed out that if we have:
    
    XXX = " A"
    XXX_remove_inactive-override = "YY"
    
    then XXX can become "A" and the leading space can be removed. This is because
    the remove override code changes the variable value even when there is no
    removals active. In the process it dirties the cache.
    
    We don't really need to do this so tweak the code accordingly.
    
    (Bitbake rev: 2bc4d35fb32defc59cd6ed1fc87e35924c201a5c)
    
    Signed-off-by: Richard Purdie <richard purdie linuxfoundation org>

 bitbake/lib/bb/data_smart.py |   15 ++++++++-------
 1 files changed, 8 insertions(+), 7 deletions(-)
---
diff --git a/bitbake/lib/bb/data_smart.py b/bitbake/lib/bb/data_smart.py
index 79d591a..0cd4168 100644
--- a/bitbake/lib/bb/data_smart.py
+++ b/bitbake/lib/bb/data_smart.py
@@ -784,13 +784,14 @@ class DataSmart(MutableMapping):
                 if match:
                     removes.extend(self.expand(r).split())
 
-            filtered = filter(lambda v: v not in removes,
-                              value.split())
-            value = " ".join(filtered)
-            if expand and var in self.expand_cache:
-                 # We need to ensure the expand cache has the correct value
-                 # flag == "_content" here
-                self.expand_cache[var].value = value
+            if removes:
+                filtered = filter(lambda v: v not in removes,
+                                  value.split())
+                value = " ".join(filtered)
+                if expand and var in self.expand_cache:
+                    # We need to ensure the expand cache has the correct value
+                    # flag == "_content" here
+                    self.expand_cache[var].value = value
         return value
 
     def delVarFlag(self, var, flag, **loginfo):


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]