From f0aef9953d3504e673c8572f1ae64cefdf678b0f Mon Sep 17 00:00:00 2001 From: Cristiana Voicu Date: Fri, 25 Jan 2013 16:10:12 +0200 Subject: bitbake: bitbake & hob: implement functions to assure consistency for configuration files Added a new command in bitbake to save a variable in a file; added a function in cooker which is called by this command. Added new command in bitbake to enable/disable data tracking. The function saveConfigurationVar from cooker.py saves a variable in the file that is received by argument. It checks all the operations made on that variable, using the history. If it's the first time when it does some changes on a variable,it comments the lines where an operation is made on it, and it sets it in a line to the end of file. If it's not the first time(it has a comment before), it replaces the line. Made some changes in hob to save the variables from bblayers.conf and local.conf using the bitbake command. [YOCTO #2934] (Bitbake rev: 55b814ccfa413d461d12956896364ab63eed70a8) Signed-off-by: Cristiana Voicu Signed-off-by: Richard Purdie --- bitbake/lib/bb/ui/crumbs/template.py | 24 ------------------------ 1 file changed, 24 deletions(-) (limited to 'bitbake/lib/bb/ui/crumbs/template.py') diff --git a/bitbake/lib/bb/ui/crumbs/template.py b/bitbake/lib/bb/ui/crumbs/template.py index e303c3a6b8..92c438f000 100644 --- a/bitbake/lib/bb/ui/crumbs/template.py +++ b/bitbake/lib/bb/ui/crumbs/template.py @@ -137,8 +137,6 @@ class RecipeFile(ConfigFile): class TemplateMgr(gobject.GObject): - __gLocalVars__ = ["MACHINE", "PACKAGE_CLASSES", "DISTRO", "DL_DIR", "SSTATE_DIR", "SSTATE_MIRRORS", "PARALLEL_MAKE", "BB_NUMBER_THREADS", "CONF_VERSION"] - __gBBLayersVars__ = ["BBLAYERS", "LCONF_VERSION"] __gRecipeVars__ = ["DEPENDS", "IMAGE_INSTALL"] def __init__(self): @@ -152,37 +150,21 @@ class TemplateMgr(gobject.GObject): def convert_to_template_pathfilename(cls, filename, path): return "%s/%s%s%s" % (path, "template-", filename, ".hob") - @classmethod - def convert_to_bblayers_pathfilename(cls, filename, path): - return "%s/%s%s%s" % (path, "bblayers-", filename, ".conf") - - @classmethod - def convert_to_local_pathfilename(cls, filename, path): - return "%s/%s%s%s" % (path, "local-", filename, ".conf") - @classmethod def convert_to_image_pathfilename(cls, filename, path): return "%s/%s%s%s" % (path, "hob-image-", filename, ".bb") def open(self, filename, path): self.template_hob = HobTemplateFile(TemplateMgr.convert_to_template_pathfilename(filename, path)) - self.bblayers_conf = ConfigFile(TemplateMgr.convert_to_bblayers_pathfilename(filename, path)) - self.local_conf = ConfigFile(TemplateMgr.convert_to_local_pathfilename(filename, path)) self.image_bb = RecipeFile(TemplateMgr.convert_to_image_pathfilename(filename, path)) def setVar(self, var, val): - if var in TemplateMgr.__gLocalVars__: - self.local_conf.setVar(var, val) - if var in TemplateMgr.__gBBLayersVars__: - self.bblayers_conf.setVar(var, val) if var in TemplateMgr.__gRecipeVars__: self.image_bb.setVar(var, val) self.template_hob.setVar(var, val) def save(self): - self.local_conf.save() - self.bblayers_conf.save() self.image_bb.save() self.template_hob.save() @@ -200,12 +182,6 @@ class TemplateMgr(gobject.GObject): if self.template_hob: del self.template_hob template_hob = None - if self.bblayers_conf: - del self.bblayers_conf - self.bblayers_conf = None - if self.local_conf: - del self.local_conf - self.local_conf = None if self.image_bb: del self.image_bb self.image_bb = None -- cgit v1.2.3-54-g00ecf