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/command.py | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'bitbake/lib/bb/command.py') diff --git a/bitbake/lib/bb/command.py b/bitbake/lib/bb/command.py index 0fed25a3ed..59336bbee7 100644 --- a/bitbake/lib/bb/command.py +++ b/bitbake/lib/bb/command.py @@ -174,6 +174,18 @@ class CommandsSync: value = str(params[1]) command.cooker.configuration.data.setVar(varname, value) + def enableDataTracking(self, command, params): + """ + Enable history tracking for variables + """ + command.cooker.enableDataTracking() + + def disableDataTracking(self, command, params): + """ + Disable history tracking for variables + """ + command.cooker.disableDataTracking() + def initCooker(self, command, params): """ Init the cooker to initial state with nothing parsed @@ -210,6 +222,12 @@ class CommandsSync: package_queue = params[2] return command.cooker.generateNewImage(image, base_image, package_queue) + def setVarFile(self, command, params): + var = params[0] + val = params[1] + default_file = params[2] + command.cooker.saveConfigurationVar(var, val, default_file) + class CommandsAsync: """ A class of asynchronous commands -- cgit v1.2.3-54-g00ecf