>From 21c0b340716fb5fa82b06ec4c5b8ffa4ffc97b48 Mon Sep 17 00:00:00 2001 From: Richard Purdie Date: Tue, 31 May 2011 23:52:50 +0100 Subject: [PATCH 2/2] bitbake/data_smart: Change overrides behaviour to remove expanded variables from the datastore Currently if you do: OVERRIDES = "z" DEPENDS_prepend = "a " DEPENDS = "b" DEPENDS_z = "c" d.update_data() d.getVar("DEPENDS") gives "a c" d.update_data() d.getVar("DEPENDS") then gives "c" This patch changes the behaviour such that at the time bitbake expands the DEPENDS_z override, it removes "DEPENDS_z" from the data store. In the above example this would mean that it wouldn't matter how often you call d.update_data(), you'd always get "a c" back. See the bitbake-devel mailing list for further discussion and analysis of the potential impact of this change. Signed-off-by: Richard Purdie --- bitbake/lib/bb/data_smart.py | 13 +++++++++---- 1 files changed, 9 insertions(+), 4 deletions(-) diff --git a/bitbake/lib/bb/data_smart.py b/bitbake/lib/bb/data_smart.py index 67866d5..a956104 100644 --- a/bitbake/lib/bb/data_smart.py +++ b/bitbake/lib/bb/data_smart.py @@ -172,11 +172,15 @@ class DataSmart(MutableMapping): if o not in self._seen_overrides: continue - vars = self._seen_overrides[o] + vars = self._seen_overrides[o].copy() for var in vars: name = var[:-l] try: self.setVar(name, self.getVar(var, False)) + #if name.find("PREF") != -1: + # bb.note("Removing %s as set %s" % (var, name)) + self.delVar(var) + self._seen_overrides[o].remove(var) except Exception: logger.info("Untracked delVar") @@ -258,9 +262,10 @@ class DataSmart(MutableMapping): # more cookies for the cookie monster if '_' in var: override = var[var.rfind('_')+1:] - if override not in self._seen_overrides: - self._seen_overrides[override] = set() - self._seen_overrides[override].add( var ) + if len(override) > 0: + if override not in self._seen_overrides: + self._seen_overrides[override] = set() + self._seen_overrides[override].add( var ) # setting var self.dict[var]["content"] = value -- 1.7.4.1