Don't drop parameters in run-script (MR 2230)
Note that the parameters aren't included directly in the sh -c command string, but instead as additional parameters after. That avoids having to find a cross-shell approach for quoting them in a way that works inside the string (there doesn't seem to be one). That's also the reason for the additional "sh" parameter: The first parameter after the command string becomes the command name ($0), the ones after positional parameters.
This commit is contained in:
parent
7dd565f7f3
commit
23a8d14d4a
|
@ -256,11 +256,12 @@ set_alias_make() {
|
|||
cmd="_run_script() {"
|
||||
cmd="$cmd echo '*** pmbootstrap envkernel.sh active for $PWD! ***';"
|
||||
cmd="$cmd _script=\"\$1\";"
|
||||
cmd="$cmd shift;"
|
||||
cmd="$cmd if [ -e \"\$_script\" ]; then"
|
||||
cmd="$cmd echo \"Running \$_script in the chroot native /mnt/linux/\";"
|
||||
cmd="$cmd pmbootstrap -q chroot --user -- sh -c \"cd /mnt/linux;"
|
||||
cmd="$cmd srcdir=/mnt/linux builddir=/mnt/linux/.output tmpdir=/tmp/envkernel"
|
||||
cmd="$cmd ./\"\$_script\"\";"
|
||||
cmd="$cmd ./\"\$_script\" \\\"\\\$@\\\"\" \"sh\" \"\$@\";"
|
||||
cmd="$cmd else"
|
||||
cmd="$cmd echo \"ERROR: \$_script not found.\";"
|
||||
cmd="$cmd fi;"
|
||||
|
|
Loading…
Reference in New Issue