]> code.ossystems Code Review - openembedded-core.git/commitdiff
bitbake/data_smart.py: Fix error where update-rc.d would not get added to the depende...
authorRichard Purdie <rpurdie@linux.intel.com>
Tue, 15 Dec 2009 22:13:52 +0000 (22:13 +0000)
committerRichard Purdie <rpurdie@linux.intel.com>
Wed, 16 Dec 2009 08:39:47 +0000 (08:39 +0000)
If there was a variable such as:

X_${Y}_append = "Z"

The "Z" would be lost if X_${Y} was unset. This was due to a bug in the renameVar
function used by expandKeys().

Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
bitbake/lib/bb/data_smart.py

index c93aea7fef3dc900d435a85e472db765a60cc6cd..988d5c3578fb0a631355486a981781c72f3308d4 100644 (file)
@@ -171,14 +171,15 @@ class DataSmart:
         Rename the variable key to newkey 
         """
         val = self.getVar(key, 0)
-        if val is None:
-            return
-
-        self.setVar(newkey, val)
+        if val is not None:
+            self.setVar(newkey, val)
 
         for i in ('_append', '_prepend'):
+            src = self.getVarFlag(key, i)
+            if src is None:
+                continue
+
             dest = self.getVarFlag(newkey, i) or []
-            src = self.getVarFlag(key, i) or []
             dest.extend(src)
             self.setVarFlag(newkey, i, dest)