diff options
| author | Johannes Schneider <johannes.schneider@leica-geosystems.com> | 2025-11-05 20:06:31 +0100 |
|---|---|---|
| committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2025-11-06 18:03:46 +0000 |
| commit | baee94fa33b8ff41c59845cb2dd2145f18a719ae (patch) | |
| tree | fc50286c2dc01181fef0ba4cf5146698d1aa5181 /bitbake/bin/bitbake-setup | |
| parent | a65d753286a602d2a27467e1899cdaa4bc12711c (diff) | |
| download | poky-baee94fa33b8ff41c59845cb2dd2145f18a719ae.tar.gz | |
bitbake: bitbake-setup: rename function 'default_settings_path' to 'topdir_settings_path'
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')
(Bitbake rev: 3df994f773abbd1d0240e721f5fd29d4b021bfb5)
Signed-off-by: Johannes Schneider <johannes.schneider@leica-geosystems.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/bin/bitbake-setup')
| -rwxr-xr-x | bitbake/bin/bitbake-setup | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/bitbake/bin/bitbake-setup b/bitbake/bin/bitbake-setup index 3cd67805fe..a9035e7c81 100755 --- a/bitbake/bin/bitbake-setup +++ b/bitbake/bin/bitbake-setup | |||
| @@ -634,9 +634,6 @@ def install_buildtools(top_dir, settings, args, d): | |||
| 634 | print("Buildtools archive is downloaded into {} and its content installed into {}".format(buildtools_download_dir, buildtools_install_dir)) | 634 | print("Buildtools archive is downloaded into {} and its content installed into {}".format(buildtools_download_dir, buildtools_install_dir)) |
| 635 | subprocess.check_call("{} -d {} --downloads-directory {}".format(install_buildtools, buildtools_install_dir, buildtools_download_dir), shell=True) | 635 | subprocess.check_call("{} -d {} --downloads-directory {}".format(install_buildtools, buildtools_install_dir, buildtools_download_dir), shell=True) |
| 636 | 636 | ||
| 637 | def default_settings_path(top_dir): | ||
| 638 | return os.path.join(top_dir, 'settings.conf') | ||
| 639 | |||
| 640 | def create_siteconf(top_dir, non_interactive=True): | 637 | def create_siteconf(top_dir, non_interactive=True): |
| 641 | siteconfpath = os.path.join(top_dir, 'site.conf') | 638 | siteconfpath = os.path.join(top_dir, 'site.conf') |
| 642 | print('A common site.conf file will be created, please edit or replace before running builds\n {}\n'.format(siteconfpath)) | 639 | 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): | |||
| 653 | with open(siteconfpath, 'w') as siteconffile: | 650 | with open(siteconfpath, 'w') as siteconffile: |
| 654 | siteconffile.write('# This file is intended for build host-specific bitbake settings\n') | 651 | siteconffile.write('# This file is intended for build host-specific bitbake settings\n') |
| 655 | 652 | ||
| 653 | def topdir_settings_path(top_dir): | ||
| 654 | return os.path.join(top_dir, 'settings.conf') | ||
| 655 | |||
| 656 | def global_settings_path(args): | 656 | def global_settings_path(args): |
| 657 | return os.path.abspath(args.global_settings) if args.global_settings else os.path.join(os.path.expanduser('~'), '.config', 'bitbake-setup', 'settings.conf') | 657 | return os.path.abspath(args.global_settings) if args.global_settings else os.path.join(os.path.expanduser('~'), '.config', 'bitbake-setup', 'settings.conf') |
| 658 | 658 | ||
| @@ -667,7 +667,7 @@ def change_setting(top_dir, args): | |||
| 667 | if vars(args)['global']: | 667 | if vars(args)['global']: |
| 668 | settings_path = global_settings_path(args) | 668 | settings_path = global_settings_path(args) |
| 669 | else: | 669 | else: |
| 670 | settings_path = default_settings_path(top_dir) | 670 | settings_path = topdir_settings_path(top_dir) |
| 671 | settings = load_settings(settings_path) | 671 | settings = load_settings(settings_path) |
| 672 | 672 | ||
| 673 | if args.subcommand == 'set': | 673 | if args.subcommand == 'set': |
| @@ -709,7 +709,7 @@ def get_top_dir(args, settings): | |||
| 709 | setup_dir_via_bbpath = get_setup_dir_via_bbpath() | 709 | setup_dir_via_bbpath = get_setup_dir_via_bbpath() |
| 710 | if setup_dir_via_bbpath: | 710 | if setup_dir_via_bbpath: |
| 711 | top_dir = os.path.dirname(setup_dir_via_bbpath) | 711 | top_dir = os.path.dirname(setup_dir_via_bbpath) |
| 712 | if os.path.exists(default_settings_path(top_dir)): | 712 | if os.path.exists(topdir_settings_path(top_dir)): |
| 713 | return top_dir | 713 | return top_dir |
| 714 | 714 | ||
| 715 | if hasattr(args, 'setup_dir'): | 715 | if hasattr(args, 'setup_dir'): |
| @@ -720,10 +720,10 @@ def get_top_dir(args, settings): | |||
| 720 | top_dir_name = settings['default']['top-dir-name'] | 720 | top_dir_name = settings['default']['top-dir-name'] |
| 721 | return os.path.join(top_dir_prefix, top_dir_name) | 721 | return os.path.join(top_dir_prefix, top_dir_name) |
| 722 | 722 | ||
| 723 | def merge_settings(builtin_settings, global_settings, local_settings, cmdline_settings): | 723 | def merge_settings(builtin_settings, global_settings, topdir_settings, cmdline_settings): |
| 724 | all_settings = builtin_settings | 724 | all_settings = builtin_settings |
| 725 | 725 | ||
| 726 | for s in (global_settings, local_settings): | 726 | for s in (global_settings, topdir_settings): |
| 727 | for section, section_settings in s.items(): | 727 | for section, section_settings in s.items(): |
| 728 | for setting, value in section_settings.items(): | 728 | for setting, value in section_settings.items(): |
| 729 | all_settings[section][setting] = value | 729 | all_settings[section][setting] = value |
| @@ -841,7 +841,7 @@ def main(): | |||
| 841 | # This cannot be set with the rest of the builtin settings as top_dir needs to be determined first | 841 | # This cannot be set with the rest of the builtin settings as top_dir needs to be determined first |
| 842 | builtin_settings['default']['dl-dir'] = os.path.join(top_dir, '.bitbake-setup-downloads') | 842 | builtin_settings['default']['dl-dir'] = os.path.join(top_dir, '.bitbake-setup-downloads') |
| 843 | 843 | ||
| 844 | topdir_settings = load_settings(default_settings_path(top_dir)) | 844 | topdir_settings = load_settings(topdir_settings_path(top_dir)) |
| 845 | all_settings = merge_settings(builtin_settings, global_settings, topdir_settings, args.cmdline_settings) | 845 | all_settings = merge_settings(builtin_settings, global_settings, topdir_settings, args.cmdline_settings) |
| 846 | 846 | ||
| 847 | if args.func == settings_func: | 847 | if args.func == settings_func: |
