fix bashisms in testsuite/
These places use ${var/search/replace}, $((n++) and `type -p' constructs which are not-so-standard. Replace with equivalent constructs. Signed-off-by: Michael Tokarev <mjt@tls.msk.ru> Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
This commit is contained in:
parent
5e63776212
commit
afa63b2dcd
@ -1,8 +1,6 @@
|
|||||||
h=x$(busybox hostid)
|
h=x$(busybox hostid)
|
||||||
# Is $h a sequence of hex numbers?
|
# Is $h a sequence of hex numbers?
|
||||||
x="${h//[0123456789abcdef]/x}"
|
case "$h" in
|
||||||
x="${x//xxx/x}"
|
x*[!0-9a-f]*) false;;
|
||||||
x="${x//xxx/x}"
|
*) true;;
|
||||||
x="${x//xxx/x}"
|
esac
|
||||||
x="${x//xx/x}"
|
|
||||||
test x"$x" = x"x"
|
|
||||||
|
@ -30,7 +30,7 @@ result=`(
|
|||||||
n=0
|
n=0
|
||||||
while test $n -le 999; do
|
while test $n -le 999; do
|
||||||
echo "$text" | head -c $n | "$sum"
|
echo "$text" | head -c $n | "$sum"
|
||||||
: $((n++))
|
n=$(($n+1))
|
||||||
done | "$sum"
|
done | "$sum"
|
||||||
)`
|
)`
|
||||||
|
|
||||||
|
@ -56,10 +56,10 @@ optional()
|
|||||||
{
|
{
|
||||||
SKIP=
|
SKIP=
|
||||||
while test "$1"; do
|
while test "$1"; do
|
||||||
if test x"${OPTIONFLAGS/*:$1:*/y}" != x"y"; then
|
case "${OPTIONFLAGS}" in
|
||||||
SKIP=1
|
*:$1:*) ;;
|
||||||
return
|
*) SKIP=1; return ;;
|
||||||
fi
|
esac
|
||||||
shift
|
shift
|
||||||
done
|
done
|
||||||
}
|
}
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
BUSYBOX=$(type -p busybox)
|
BUSYBOX=$(command -pv busybox)
|
||||||
SAVED_PATH=$PATH
|
SAVED_PATH=$PATH
|
||||||
unset PATH
|
unset PATH
|
||||||
$BUSYBOX which ls
|
$BUSYBOX which ls
|
||||||
|
Loading…
Reference in New Issue
Block a user