diff mbox series

bitbake-setup: do not include prefix/ when using fragment names in setup directory variable expansions

Message ID 20251120162441.218062-1-alex.kanavin@gmail.com
State New
Headers show
Series bitbake-setup: do not include prefix/ when using fragment names in setup directory variable expansions | expand

Commit Message

Alexander Kanavin Nov. 20, 2025, 4:24 p.m. UTC
From: Alexander Kanavin <alex@linutronix.de>

Fragment prefixes are top level namespaces like distro/ machine/ yocto/
and so on; when constructing a setup directory name they are redundant
and add clutter. If necessary, they can be re-added directly into
the format string of the setup-dir-name parameter in the json config.

Particularly, the default setup dir names suggested by bitbake-setup
in default configurations look a lot better:

Before:
distro_poky-master

After:
poky-master

Signed-off-by: Alexander Kanavin <alex@linutronix.de>
---
 bin/bitbake-setup | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/bin/bitbake-setup b/bin/bitbake-setup
index 436456a47..75be90940 100755
--- a/bin/bitbake-setup
+++ b/bin/bitbake-setup
@@ -501,7 +501,7 @@  def init_config(top_dir, settings, args):
         setup_dir_name = "{}-{}".format(upstream_config['name']," ".join(upstream_config['non-interactive-cmdline-options'][1:]).replace(" ","-").replace("/","_"))
         if 'setup-dir-name' in upstream_config['bitbake-config']:
             mapping = {
-                    k: v.replace(" ", "-").replace("/", "_")
+                    k: v.partition("/")[2].replace(" ", "-").replace("/", "_")
                     for k, v in upstream_config['bitbake-config']['oe-fragment-choices'].items()
             }
             config_setup_dir_name = string.Template(upstream_config['bitbake-config']['setup-dir-name']).substitute(mapping)