diff mbox series

[1/6] bitbake-setup: rename function 'default_settings_path' to 'topdir_settings_path'

Message ID 20251105190636.679388-1-alex.kanavin@gmail.com
State Accepted, archived
Commit 3df994f773abbd1d0240e721f5fd29d4b021bfb5
Headers show
Series [1/6] bitbake-setup: rename function 'default_settings_path' to 'topdir_settings_path' | expand

Commit Message

Alexander Kanavin Nov. 5, 2025, 7:06 p.m. UTC
From: Johannes Schneider <johannes.schneider@leica-geosystems.com>

Rename the function to align with the corresponding
'global_settings_path' function, and move it down just above the
later.

This is done to differentiate from the built-in default settings, and
to align with the other places in the code that use 'topdir_settings'
(or 'global_settings')

Signed-off-by: Johannes Schneider <johannes.schneider@leica-geosystems.com>
---
 bin/bitbake-setup | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)
diff mbox series

Patch

diff --git a/bin/bitbake-setup b/bin/bitbake-setup
index 3cd67805f..a9035e7c8 100755
--- a/bin/bitbake-setup
+++ b/bin/bitbake-setup
@@ -634,9 +634,6 @@  def install_buildtools(top_dir, settings, args, d):
     print("Buildtools archive is downloaded into {} and its content installed into {}".format(buildtools_download_dir, buildtools_install_dir))
     subprocess.check_call("{} -d {} --downloads-directory {}".format(install_buildtools, buildtools_install_dir, buildtools_download_dir), shell=True)
 
-def default_settings_path(top_dir):
-    return os.path.join(top_dir, 'settings.conf')
-
 def create_siteconf(top_dir, non_interactive=True):
     siteconfpath = os.path.join(top_dir, 'site.conf')
     print('A common site.conf file will be created, please edit or replace before running builds\n    {}\n'.format(siteconfpath))
@@ -653,6 +650,9 @@  def create_siteconf(top_dir, non_interactive=True):
     with open(siteconfpath, 'w') as siteconffile:
         siteconffile.write('# This file is intended for build host-specific bitbake settings\n')
 
+def topdir_settings_path(top_dir):
+    return os.path.join(top_dir, 'settings.conf')
+
 def global_settings_path(args):
     return os.path.abspath(args.global_settings) if args.global_settings else os.path.join(os.path.expanduser('~'), '.config', 'bitbake-setup', 'settings.conf')
 
@@ -667,7 +667,7 @@  def change_setting(top_dir, args):
     if vars(args)['global']:
         settings_path = global_settings_path(args)
     else:
-        settings_path = default_settings_path(top_dir)
+        settings_path = topdir_settings_path(top_dir)
     settings = load_settings(settings_path)
 
     if args.subcommand == 'set':
@@ -709,7 +709,7 @@  def get_top_dir(args, settings):
     setup_dir_via_bbpath = get_setup_dir_via_bbpath()
     if setup_dir_via_bbpath:
         top_dir = os.path.dirname(setup_dir_via_bbpath)
-        if os.path.exists(default_settings_path(top_dir)):
+        if os.path.exists(topdir_settings_path(top_dir)):
             return top_dir
 
     if hasattr(args, 'setup_dir'):
@@ -720,10 +720,10 @@  def get_top_dir(args, settings):
     top_dir_name = settings['default']['top-dir-name']
     return os.path.join(top_dir_prefix, top_dir_name)
 
-def merge_settings(builtin_settings, global_settings, local_settings, cmdline_settings):
+def merge_settings(builtin_settings, global_settings, topdir_settings, cmdline_settings):
     all_settings = builtin_settings
 
-    for s in (global_settings, local_settings):
+    for s in (global_settings, topdir_settings):
         for section, section_settings in s.items():
             for setting, value in section_settings.items():
                 all_settings[section][setting] = value
@@ -841,7 +841,7 @@  def main():
         # This cannot be set with the rest of the builtin settings as top_dir needs to be determined first
         builtin_settings['default']['dl-dir'] = os.path.join(top_dir, '.bitbake-setup-downloads')
 
-        topdir_settings = load_settings(default_settings_path(top_dir))
+        topdir_settings = load_settings(topdir_settings_path(top_dir))
         all_settings = merge_settings(builtin_settings, global_settings, topdir_settings, args.cmdline_settings)
 
         if args.func == settings_func: