diff options
author | Denys Vlasenko <vda.linux@googlemail.com> | 2017-01-24 20:52:42 +0100 |
---|---|---|
committer | Denys Vlasenko <vda.linux@googlemail.com> | 2017-01-24 20:52:42 +0100 |
commit | bca4ea8b68403e6f751341b82c65937f14590679 (patch) | |
tree | 21c637e653ceaa259599cecf8fb57a9de8ad6172 | |
parent | 89193f985bf50af702e0f98a3c86573277c03287 (diff) | |
download | busybox-w32-bca4ea8b68403e6f751341b82c65937f14590679.tar.gz busybox-w32-bca4ea8b68403e6f751341b82c65937f14590679.tar.bz2 busybox-w32-bca4ea8b68403e6f751341b82c65937f14590679.zip |
remove "local" bashism from a few scripts
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
-rwxr-xr-x | examples/depmod | 2 | ||||
-rwxr-xr-x | scripts/gen_build_files.sh | 4 | ||||
-rwxr-xr-x | scripts/trylink | 14 | ||||
-rwxr-xr-x | testsuite/runtest | 10 |
4 files changed, 15 insertions, 15 deletions
diff --git a/examples/depmod b/examples/depmod index d769590d0..8d421c6ab 100755 --- a/examples/depmod +++ b/examples/depmod | |||
@@ -7,7 +7,7 @@ | |||
7 | # Licensed under GPLv2, see file LICENSE in this source tree. | 7 | # Licensed under GPLv2, see file LICENSE in this source tree. |
8 | # | 8 | # |
9 | 9 | ||
10 | local BASE="${1:-/usr/lib/modules}" | 10 | BASE="${1:-/usr/lib/modules}" |
11 | 11 | ||
12 | find "$BASE" -name '*.ko.gz' | while read I ; do | 12 | find "$BASE" -name '*.ko.gz' | while read I ; do |
13 | N=`basename "$I" '.ko.gz'` | 13 | N=`basename "$I" '.ko.gz'` |
diff --git a/scripts/gen_build_files.sh b/scripts/gen_build_files.sh index ebee17c64..f79fa2f83 100755 --- a/scripts/gen_build_files.sh +++ b/scripts/gen_build_files.sh | |||
@@ -20,7 +20,9 @@ chk() { status "CHK" "$@"; } | |||
20 | generate() | 20 | generate() |
21 | { | 21 | { |
22 | # NB: data to be inserted at INSERT line is coming on stdin | 22 | # NB: data to be inserted at INSERT line is coming on stdin |
23 | local src="$1" dst="$2" header="$3" | 23 | src="$1" |
24 | dst="$2" | ||
25 | header="$3" | ||
24 | #chk "${dst}" | 26 | #chk "${dst}" |
25 | { | 27 | { |
26 | # Need to use printf: different shells have inconsistent | 28 | # Need to use printf: different shells have inconsistent |
diff --git a/scripts/trylink b/scripts/trylink index c2a431626..9f288c141 100755 --- a/scripts/trylink +++ b/scripts/trylink | |||
@@ -46,8 +46,7 @@ try() { | |||
46 | } | 46 | } |
47 | 47 | ||
48 | check_cc() { | 48 | check_cc() { |
49 | local tempname="$(mktemp tmp.XXXXXXXXXX)" | 49 | tempname="$(mktemp tmp.XXXXXXXXXX)" |
50 | local r | ||
51 | echo "int main(int argc,char**argv){return argv?argc:0;}" >"$tempname".c | 50 | echo "int main(int argc,char**argv){return argv?argc:0;}" >"$tempname".c |
52 | # Can use "-o /dev/null", but older gcc tend to *unlink it* on failure! :( | 51 | # Can use "-o /dev/null", but older gcc tend to *unlink it* on failure! :( |
53 | # Was using "-xc /dev/null", but we need a valid C program. | 52 | # Was using "-xc /dev/null", but we need a valid C program. |
@@ -55,14 +54,13 @@ check_cc() { | |||
55 | # '... -D"BB_VER=KBUILD_STR(1.N.M)" ...' | 54 | # '... -D"BB_VER=KBUILD_STR(1.N.M)" ...' |
56 | # and we need shell to process quotes! | 55 | # and we need shell to process quotes! |
57 | $CC $CFLAGS $LDFLAGS $1 "$tempname".c -o "$tempname" >/dev/null 2>&1 | 56 | $CC $CFLAGS $LDFLAGS $1 "$tempname".c -o "$tempname" >/dev/null 2>&1 |
58 | r=$? | 57 | exitcode=$? |
59 | rm -f "$tempname" "$tempname".c "$tempname".o | 58 | rm -f "$tempname" "$tempname".c "$tempname".o |
60 | return $r | 59 | return $exitcode |
61 | } | 60 | } |
62 | 61 | ||
63 | check_libc_is_glibc() { | 62 | check_libc_is_glibc() { |
64 | local tempname="$(mktemp tmp.XXXXXXXXXX)" | 63 | tempname="$(mktemp tmp.XXXXXXXXXX)" |
65 | local r | ||
66 | echo "\ | 64 | echo "\ |
67 | #include <stdlib.h> | 65 | #include <stdlib.h> |
68 | /* Apparently uclibc defines __GLIBC__ (compat trick?). Oh well. */ | 66 | /* Apparently uclibc defines __GLIBC__ (compat trick?). Oh well. */ |
@@ -71,9 +69,9 @@ check_libc_is_glibc() { | |||
71 | #endif | 69 | #endif |
72 | " >"$tempname".c | 70 | " >"$tempname".c |
73 | ! $CC $CFLAGS "$tempname".c -c -o "$tempname".o >/dev/null 2>&1 | 71 | ! $CC $CFLAGS "$tempname".c -c -o "$tempname".o >/dev/null 2>&1 |
74 | r=$? | 72 | exitcode=$? |
75 | rm -f "$tempname" "$tempname".c "$tempname".o | 73 | rm -f "$tempname" "$tempname".c "$tempname".o |
76 | return $r | 74 | return $exitcode |
77 | } | 75 | } |
78 | 76 | ||
79 | EXE="$1" | 77 | EXE="$1" |
diff --git a/testsuite/runtest b/testsuite/runtest index 51575d926..44f9cd1a1 100755 --- a/testsuite/runtest +++ b/testsuite/runtest | |||
@@ -12,12 +12,12 @@ total_failed=0 | |||
12 | # Option -e will make testcase stop on the first failed command. | 12 | # Option -e will make testcase stop on the first failed command. |
13 | run_applet_testcase() | 13 | run_applet_testcase() |
14 | { | 14 | { |
15 | local applet="$1" | 15 | applet="$1" |
16 | local testcase="$2" | 16 | testcase="$2" |
17 | 17 | ||
18 | local status=0 | 18 | status=0 |
19 | local uc_applet=$(echo "$applet" | tr a-z A-Z) | 19 | uc_applet=$(echo "$applet" | tr a-z A-Z) |
20 | local testname="$testcase" | 20 | testname="$testcase" |
21 | 21 | ||
22 | testname="${testname##*/}" # take basename | 22 | testname="${testname##*/}" # take basename |
23 | if grep "^# CONFIG_$uc_applet is not set$" "$bindir/.config" >/dev/null; then | 23 | if grep "^# CONFIG_$uc_applet is not set$" "$bindir/.config" >/dev/null; then |