Skip to contentSkip to conversation

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

PATCH New Joshua Watt 1 participant 1 message Nov 11, 2025

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 bitbake-setup: Only set top-dir-prefix and top-dir-name in global settings

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.

---
 bin/bitbake-setup | 9 +++++++++
 1 file changed, 9 insertions(+)
bin/bitbake-setup +9 -0
index caec990c2..c32381e50 100755
@@ -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)
Signature · 1 line
2.51.1