summaryrefslogtreecommitdiffstats
path: root/bitbake/lib/bb/tests/setup.py
diff options
context:
space:
mode:
authorAlexander Kanavin <alex@linutronix.de>2025-10-08 18:56:59 +0200
committerRichard Purdie <richard.purdie@linuxfoundation.org>2025-10-09 16:46:45 +0100
commit5dda14aa9403c14c26896f6fe6ec8889d215dded (patch)
treed563975a99f549271b571264cd8099b193e64c93 /bitbake/lib/bb/tests/setup.py
parentcfc377635cf5c9a8a8dff9de7c4e2031dee2e2f2 (diff)
downloadpoky-5dda14aa9403c14c26896f6fe6ec8889d215dded.tar.gz
bitbake: bitbake-setup: rework the settings handling
This is the outcome of various discussions, suggestions and pull requests on github. What has specifically changed? 1. The sources for the settings are no longer separated, but are stacked and given priorities, from highest to lowest: a. '--setting section key value' on the command line b. a settings file in the top directory c. a global settings file in ~/.config/bitbake-setup/ (or in a file pointed to by --global-settings) Any setting can be in any of these three locations (other than top dir name and prefix which do not make sense in the settings file in the top directory). 2. A global settings file must contain all of the needed settings, while a settings file in the top directory can be empty (and this is how they are written out if they do not exist). Specifically, both dl-dir and registry settings have been relocated to the global file, and dl-dir defaults to ~/.cache/bitbake-setup/downloads, rather than somewhere in top dir. 3. The file name for both global and top dir settings is now 'settings.conf'. 4. --top-dir-prefix and --top-dir-name options have been removed and superseded by a generic, universal --setting option. 5. 'install-settings' command has been removed, as it is no longer does anything useful, and is superseded by the 'setting' command (see below). 'install-global-settings' has been retained, to be able to have a set of global defaults that can be changed without initializing a build. 6. 'change-setting', 'change-global-setting' and 'install-settings' have all been replaced by a single 'setting' command that mimics 'git config' in its parameters: a. Changing a setting: bitbake-setup setting [--global] default dl-dir /path/to/downloads b. Removing a setting: bitbake-setup setting [--global] --unset default dl-dir (Bitbake rev: dbf593e4f7441e423ce4f2a8c7b0365a1c93bd23) Signed-off-by: Alexander Kanavin <alex@linutronix.de> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/lib/bb/tests/setup.py')
-rw-r--r--bitbake/lib/bb/tests/setup.py12
1 files changed, 7 insertions, 5 deletions
diff --git a/bitbake/lib/bb/tests/setup.py b/bitbake/lib/bb/tests/setup.py
index 495d1da203..22edda40e4 100644
--- a/bitbake/lib/bb/tests/setup.py
+++ b/bitbake/lib/bb/tests/setup.py
@@ -235,16 +235,18 @@ print("BBPATH is {{}}".format(os.environ["BBPATH"]))
235 out = self.runbbsetup("install-global-settings") 235 out = self.runbbsetup("install-global-settings")
236 settings_path = "{}/global-config".format(self.tempdir) 236 settings_path = "{}/global-config".format(self.tempdir)
237 self.assertIn(settings_path, out[0]) 237 self.assertIn(settings_path, out[0])
238 out = self.runbbsetup("change-global-setting default top-dir-prefix {}".format(self.tempdir)) 238 out = self.runbbsetup("setting --global default top-dir-prefix {}".format(self.tempdir))
239 self.assertIn("Setting 'top-dir-prefix' in section 'default' is changed to", out[0]) 239 self.assertIn("Setting 'top-dir-prefix' in section 'default' is changed to", out[0])
240 self.assertIn("New global settings written to".format(settings_path), out[0]) 240 self.assertIn("New settings written to".format(settings_path), out[0])
241 out = self.runbbsetup("setting --global default dl-dir {}".format(os.path.join(self.tempdir, 'downloads')))
242 self.assertIn("Setting 'dl-dir' in section 'default' is changed to", out[0])
243 self.assertIn("New settings written to".format(settings_path), out[0])
241 244
242 # check that writing settings works and then adjust them to point to 245 # check that writing settings works and then adjust them to point to
243 # test registry repo 246 # test registry repo
244 out = self.runbbsetup("install-settings") 247 out = self.runbbsetup("setting default registry 'git://{};protocol=file;branch=master;rev=master'".format(self.registrypath))
245 settings_path = "{}/bitbake-builds/bitbake-setup.conf".format(self.tempdir) 248 settings_path = "{}/bitbake-builds/settings.conf".format(self.tempdir)
246 self.assertIn(settings_path, out[0]) 249 self.assertIn(settings_path, out[0])
247 out = self.runbbsetup("change-setting default registry 'git://{};protocol=file;branch=master;rev=master'".format(self.registrypath))
248 self.assertIn("Setting 'registry' in section 'default' is changed to", out[0]) 250 self.assertIn("Setting 'registry' in section 'default' is changed to", out[0])
249 self.assertIn("New settings written to".format(settings_path), out[0]) 251 self.assertIn("New settings written to".format(settings_path), out[0])
250 252