[oe-commits] [bitbake] branch 1.32 updated: data_smart: Fix unneeded variable manipulation

git at git.openembedded.org git at git.openembedded.org
Thu Mar 16 12:49:34 UTC 2017


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

rpurdie pushed a commit to branch 1.32
in repository bitbake.

The following commit(s) were added to refs/heads/1.32 by this push:
     new f1ee6df  data_smart: Fix unneeded variable manipulation
f1ee6df is described below

commit f1ee6dfd3d193a9055320bdd555c1dbaa63f9475
Author: Richard Purdie <richard.purdie at linuxfoundation.org>
AuthorDate: Fri Jan 20 11:28:04 2017 +0000

    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.
    
    Signed-off-by: Richard Purdie <richard.purdie at linuxfoundation.org>
---
 lib/bb/data_smart.py | 15 ++++++++-------
 1 file changed, 8 insertions(+), 7 deletions(-)

diff --git a/lib/bb/data_smart.py b/lib/bb/data_smart.py
index f100446..805a9a7 100644
--- a/lib/bb/data_smart.py
+++ b/lib/bb/data_smart.py
@@ -748,13 +748,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):

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


More information about the Openembedded-commits mailing list