Skip to contentSkip to conversation

bitbake-setup: Avoid unexpected positional parameter propagation when sourcing scripts

PATCH New [email protected] 1 participant 1 message Nov 25, 2025

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 bitbake-setup: Avoid unexpected positional parameter propagation when sourcing scripts

From: Changqing Li <[email protected]>

Using set to define positional parameters in the current shell causes those parameters to persist. When another script is sourced in the same shell without explicit arguments, it unexpectedly inherits these positional parameters. This change prevents such unintended propagation.

---
 bin/bitbake-setup | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
bin/bitbake-setup +1 -1
index 75be90940..8e229073a 100755
@@ -184,7 +184,7 @@ def setup_bitbake_build(bitbake_config, layerdir, setupdir, thisdir, update_bb_c
 
     def _make_init_build_env(builddir, oeinitbuildenvdir):
         builddir = os.path.realpath(builddir)
-        cmd = "cd {}\nset {}\n. ./oe-init-build-env\n".format(oeinitbuildenvdir, builddir)
+        cmd = 'cd {}\nset {}\n. ./oe-init-build-env\nset --\n'.format(oeinitbuildenvdir, builddir)
         initbuild_in_builddir = os.path.join(builddir, 'init-build-env')
 
         with open(initbuild_in_builddir, 'w') as f:
Signature · 1 line
2.34.1