From bd720fb63cef6b399619b8fbcaeb8d7710f2d6df Mon Sep 17 00:00:00 2001 From: Cristiana Voicu Date: Fri, 4 Oct 2013 16:19:45 +0300 Subject: bitbake/hob: removing extra parameters from conf files using hob In Hob settings, there is a tab to add/remove extra settings. This patch implements a way to "remove" variables from conf files, through bitbake. But, to keep the history assigment of the variables synchronized, instead of removing, it replaces the lines with blank lines. [YOCTO #5284] Signed-off-by: Cristiana Voicu Signed-off-by: Richard Purdie --- lib/bb/data_smart.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'lib/bb/data_smart.py') diff --git a/lib/bb/data_smart.py b/lib/bb/data_smart.py index b6f5b78cda..a1cbaba62b 100644 --- a/lib/bb/data_smart.py +++ b/lib/bb/data_smart.py @@ -281,9 +281,13 @@ class VariableHistory(object): lines.append(line) return lines - def del_var_history(self, var): + def del_var_history(self, var, f=None, line=None): + """If file f and line are not given, the entire history of var is deleted""" if var in self.variables: - self.variables[var] = [] + if f and line: + self.variables[var] = [ x for x in self.variables[var] if x['file']!=f and x['line']!=line] + else: + self.variables[var] = [] class DataSmart(MutableMapping): def __init__(self, special = COWDictBase.copy(), seen = COWDictBase.copy() ): -- cgit 1.2.3-korg