From 459861b9c039cba764e3e453fa34d4d4a4566e4f Mon Sep 17 00:00:00 2001
From: Richard Purdie <rpurdie@linux.intel.com>
Date: Tue, 15 Dec 2009 22:13:52 +0000
Subject: bitbake/data_smart.py: Fix error where update-rc.d would not get
 added to the dependency tree

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 | 11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)

diff --git a/bitbake/lib/bb/data_smart.py b/bitbake/lib/bb/data_smart.py
index c93aea7fef..988d5c3578 100644
--- a/bitbake/lib/bb/data_smart.py
+++ b/bitbake/lib/bb/data_smart.py
@@ -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)
             
-- 
cgit v1.2.3