[prev in list] [next in list] [prev in thread] [next in thread] 

List:       busybox
Subject:    [PATCH] make_single_applets: fix ": $((fail++))" expansion error
From:       Kang-Che Sung <explorer09 () gmail ! com>
Date:       2017-07-15 3:38:58
Message-ID: 20170715033858.4972-1-explorer09 () gmail ! com
[Download RAW message or body]

$((fail++)) is not a required expression in POSIX, and in "dash" it
could produce an error like this:

    ./make_single_applets.sh: 61: arithmetic expression: expecting primary: "fail++"

Replace this with something portable: fail=$((fail+1)) would work.

Signed-off-by: Kang-Che Sung <explorer09@gmail.com>
---
 make_single_applets.sh | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/make_single_applets.sh b/make_single_applets.sh
index 8ad7a7406..329a27d32 100755
--- a/make_single_applets.sh
+++ b/make_single_applets.sh
@@ -54,18 +54,18 @@ for app; do
 	fi
 
 	if ! yes '' | make oldconfig >busybox_make_${app}.log 2>&1; then
-		: $((fail++))
+		fail=$((fail+1))
 		echo "Config error for ${app}"
 		mv .config busybox_config_${app}
 	elif ! make $makeopts >>busybox_make_${app}.log 2>&1; then
-		: $((fail++))
+		fail=$((fail+1))
 		grep -i -e error: -e warning: busybox_make_${app}.log
 		echo "Build error for ${app}"
 		mv .config busybox_config_${app}
 	elif ! grep -q '^#define NUM_APPLETS 1$' include/NUM_APPLETS.h; then
 		grep -i -e error: -e warning: busybox_make_${app}.log
 		mv busybox busybox_${app}
-		: $((fail++))
+		fail=$((fail+1))
 		echo "NUM_APPLETS != 1 for ${app}: `cat include/NUM_APPLETS.h`"
 		mv .config busybox_config_${app}
 	else
-- 
2.13.0

_______________________________________________
busybox mailing list
busybox@busybox.net
http://lists.busybox.net/mailman/listinfo/busybox
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic