| git.druid.rocks | index | druid520 | ports | ports/ | networking/ | toybox/ | patches/ | 0001-portability-no-bash-slicing.patch |
ports/networking/toybox/patches/0001-portability-no-bash-slicing.patch
# brun()'s own "${@:2}" (bash-only positional-parameter slicing, "all
# args from $2 on") is the one genuine bash-only construct toybox's
# whole build actually needs -- confirmed for real: every other build
# script here (genconfig.sh, install.sh, change.sh, single.sh) already
# parses and runs cleanly under mksh despite its own "#!/bin/bash"
# shebang. captures $1 before shift instead, same real end result with
# nothing mksh doesn't already support.
--- a/scripts/portability.sh 2026-09-11 22:10:08.860796160 +0000
+++ b/scripts/portability.sh 2026-09-11 22:10:21.948679126 +0000
@@ -55,9 +55,11 @@
# Run a C file from scripts/*.c using $HOSTCC as necessary
brun() {
- [ ! -e "$UNSTRIPPED"/$1 -o "$UNSTRIPPED"/$1 -ot scripts/$1.c ] &&
+ prog=$1
+ [ ! -e "$UNSTRIPPED"/$prog -o "$UNSTRIPPED"/$prog -ot scripts/$prog.c ] &&
{ mkdir -p "$UNSTRIPPED" &&
- do_loudly $HOSTCC scripts/$1.c -o "$UNSTRIPPED"/$1 || exit 1; }
- do_loudly "$UNSTRIPPED"/$1 "${@:2}"
+ do_loudly $HOSTCC scripts/$prog.c -o "$UNSTRIPPED"/$prog || exit 1; }
+ shift
+ do_loudly "$UNSTRIPPED"/$prog "$@"
}