diff mbox series

[bitbake-devel] bitbake-setup: Only set top-dir-prefix and top-dir-name in global settings

Message ID 20251111160712.2818289-1-JPEWhacker@gmail.com
State New
Headers show
Series [bitbake-devel] bitbake-setup: Only set top-dir-prefix and top-dir-name in global settings | expand

Commit Message

Joshua Watt Nov. 11, 2025, 4:07 p.m. UTC
top-dir-prefix and top-dir-name only make sense to be set in the global
settings file, so if they are specified force them to the global
settings file, and warn the user that this is happening.

Signed-off-by: Joshua Watt <JPEWhacker@gmail.com>
---
 bin/bitbake-setup | 9 +++++++++
 1 file changed, 9 insertions(+)
diff mbox series

Patch

diff --git a/bin/bitbake-setup b/bin/bitbake-setup
index caec990c2..c32381e50 100755
--- a/bin/bitbake-setup
+++ b/bin/bitbake-setup
@@ -30,6 +30,12 @@  import bb.process
 
 logger = bb.msg.logger_create('bitbake-setup', sys.stdout)
 
+# These settings can only be set in the global context
+GLOBAL_ONLY_SETTINGS = (
+    "top-dir-prefix",
+    "top-dir-name",
+)
+
 def cache_dir(top_dir):
     return os.path.join(top_dir, '.bitbake-setup-cache')
 
@@ -685,6 +691,9 @@  def load_settings(settings_path):
 def change_setting(top_dir, args):
     if vars(args)['global']:
         settings_path = global_settings_path(args)
+    elif args.setting in GLOBAL_ONLY_SETTINGS:
+        print(f"{args.setting} can only be set in the global config; '--global' is implied")
+        settings_path = global_settings_path(args)
     else:
         settings_path = topdir_settings_path(top_dir)
     settings = load_settings(settings_path)