From 66d66cb487aebc9c357be20cdfcef80c3714cfd0 Mon Sep 17 00:00:00 2001
From: Chris Larson <chris_larson@mentor.com>
Date: Wed, 21 Apr 2010 16:47:10 -0700
Subject: Fix major bug that slipped in when moving update_data

The root cause is, I was testing the use of renameVar() from finalize, in
order to get flags copied over when an override is applied, but renameVar
removes the original, whereas the old code did not do so.  Going back to the
old method, will revisit the override/flags later on.

(Bitbake rev: 2f7c498abcf675e5b8de197d8056a0581670c2bd)

Signed-off-by: Chris Larson <chris_larson@mentor.com>
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
---
 bitbake/lib/bb/data_smart.py | 19 ++++++++++---------
 1 file changed, 10 insertions(+), 9 deletions(-)

diff --git a/bitbake/lib/bb/data_smart.py b/bitbake/lib/bb/data_smart.py
index 1e6501402..48f401618 100644
--- a/bitbake/lib/bb/data_smart.py
+++ b/bitbake/lib/bb/data_smart.py
@@ -94,7 +94,8 @@ class DataSmart:
 
     def finalize(self):
         """Performs final steps upon the datastore, including application of overrides"""
-        overrides = (self.getVar("OVERRIDES", True) or "").split(":")
+
+        overrides = (self.getVar("OVERRIDES", True) or "").split(":") or []
 
         #
         # Well let us see what breaks here. We used to iterate
@@ -113,7 +114,7 @@ class DataSmart:
 
         for o in overrides:
             # calculate '_'+override
-            l    = len(o)+1
+            l = len(o) + 1
 
             # see if one should even try
             if o not in self._seen_overrides:
@@ -123,18 +124,18 @@ class DataSmart:
             for var in vars:
                 name = var[:-l]
                 try:
-                    self.renameVar(var, name)
+                    self[name] = self[var]
                 except Exception:
                     bb.msg.note(1, bb.msg.domain.Data, "Untracked delVar")
 
         # now on to the appends and prepends
         if "_append" in self._special_values:
-            appends = self._special_values['_append'] or []
+            appends = self._special_values["_append"] or []
             for append in appends:
-                for (a, o) in self.getVarFlag(append, '_append') or []:
+                for (a, o) in self.getVarFlag(append, "_append") or []:
                     # maybe the OVERRIDE was not yet added so keep the append
                     if (o and o in overrides) or not o:
-                        self.delVarFlag(append, '_append')
+                        self.delVarFlag(append, "_append")
                     if o and not o in overrides:
                         continue
 
@@ -144,13 +145,13 @@ class DataSmart:
 
 
         if "_prepend" in self._special_values:
-            prepends = self._special_values['_prepend'] or []
+            prepends = self._special_values["_prepend"] or []
 
             for prepend in prepends:
-                for (a, o) in self.getVarFlag(prepend, '_prepend') or []:
+                for (a, o) in self.getVarFlag(prepend, "_prepend") or []:
                     # maybe the OVERRIDE was not yet added so keep the prepend
                     if (o and o in overrides) or not o:
-                        self.delVarFlag(prepend, '_prepend')
+                        self.delVarFlag(prepend, "_prepend")
                     if o and not o in overrides:
                         continue
 
-- 
cgit v1.2.3