From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from pigeon.gentoo.org ([208.92.234.80] helo=lists.gentoo.org) by finch.gentoo.org with esmtp (Exim 4.60) (envelope-from ) id 1RRg1H-00037O-0B for garchives@archives.gentoo.org; Sat, 19 Nov 2011 08:11:27 +0000 Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id EF76321C087; Sat, 19 Nov 2011 08:11:14 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) by pigeon.gentoo.org (Postfix) with ESMTP id 9D60221C087 for ; Sat, 19 Nov 2011 08:11:14 +0000 (UTC) Received: from pelican.gentoo.org (unknown [66.219.59.40]) (using TLSv1 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 026D81B4051 for ; Sat, 19 Nov 2011 08:11:13 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by pelican.gentoo.org (Postfix) with ESMTP id 1B93D80042 for ; Sat, 19 Nov 2011 08:11:13 +0000 (UTC) From: "Mike Frysinger" To: gentoo-commits@lists.gentoo.org Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Mike Frysinger" Message-ID: Subject: [gentoo-commits] proj/openrc:master commit in: src/test/, net/, man/, init.d/, sh/, support/openvpn/ X-VCS-Repository: proj/openrc X-VCS-Files: init.d/consolefont.in init.d/hwclock.in init.d/keymaps.in init.d/mixer.in init.d/modules.in init.d/moused.in init.d/net.lo.in init.d/network.in init.d/numlock.in init.d/rc-enabled.in init.d/termencoding.in init.d/urandom.in man/runscript.8 net/apipa.sh net/arping.sh net/clip.sh net/ifconfig.sh.BSD.in net/ifconfig.sh.Linux.in net/ifplugd.sh net/ip6to4.sh net/iproute2.sh net/iwconfig.sh.BSD.in net/iwconfig.sh.Linux.in net/netplugd.sh net/pppd.sh net/tuntap.sh net/wpa_supplicant.sh sh/functions.sh.in sh/rc-mount.sh sh/runtests.sh src/test/runtests.sh support/openvpn/up.sh X-VCS-Directories: src/test/ net/ man/ init.d/ sh/ support/openvpn/ X-VCS-Committer: vapier X-VCS-Committer-Name: Mike Frysinger X-VCS-Revision: ef1ff1b4f29762d1caf83dc2b65ccfc7cb96e140 Date: Sat, 19 Nov 2011 08:11:13 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: quoted-printable X-Archives-Salt: 22d298a8-3e76-4111-a7f7-07172ab81274 X-Archives-Hash: ac17486c1c2b9547f4b57d70860a85c1 commit: ef1ff1b4f29762d1caf83dc2b65ccfc7cb96e140 Author: Mike Frysinger gentoo org> AuthorDate: Fri Nov 11 02:46:08 2011 +0000 Commit: Mike Frysinger gentoo org> CommitDate: Sat Nov 19 07:25:36 2011 +0000 URL: http://git.overlays.gentoo.org/gitweb/?p=3Dproj/openrc.git;a=3D= commit;h=3Def1ff1b4 make shell math operations style more succulent Convert the style: var=3D$((${var} + 1)) to: : $(( var +=3D 1 )) The latter is easier to read imo. Signed-off-by: Mike Frysinger gentoo.org> --- init.d/consolefont.in | 2 +- init.d/hwclock.in | 4 ++-- init.d/keymaps.in | 2 +- init.d/mixer.in | 4 ++-- init.d/modules.in | 2 +- init.d/moused.in | 2 +- init.d/net.lo.in | 22 +++++++++++----------- init.d/network.in | 2 +- init.d/numlock.in | 2 +- init.d/rc-enabled.in | 4 ++-- init.d/termencoding.in | 2 +- init.d/urandom.in | 2 +- man/runscript.8 | 2 +- net/apipa.sh | 8 ++++---- net/arping.sh | 2 +- net/clip.sh | 2 +- net/ifconfig.sh.BSD.in | 4 ++-- net/ifconfig.sh.Linux.in | 26 +++++++++++++------------- net/ifplugd.sh | 2 +- net/ip6to4.sh | 4 ++-- net/iproute2.sh | 6 +++--- net/iwconfig.sh.BSD.in | 32 ++++++++++++++++---------------- net/iwconfig.sh.Linux.in | 30 +++++++++++++++--------------- net/netplugd.sh | 2 +- net/pppd.sh | 2 +- net/tuntap.sh | 2 +- net/wpa_supplicant.sh | 2 +- sh/functions.sh.in | 4 ++-- sh/rc-mount.sh | 2 +- sh/runtests.sh | 6 +++--- src/test/runtests.sh | 6 +++--- support/openvpn/up.sh | 2 +- 32 files changed, 98 insertions(+), 98 deletions(-) diff --git a/init.d/consolefont.in b/init.d/consolefont.in index cd0c8de..f83b003 100644 --- a/init.d/consolefont.in +++ b/init.d/consolefont.in @@ -49,7 +49,7 @@ start() retval=3D1 break fi - x=3D$(($x + 1)) + : $(( x +=3D 1 )) done eend $retval =20 diff --git a/init.d/hwclock.in b/init.d/hwclock.in index b79ff7c..cfb25ae 100644 --- a/init.d/hwclock.in +++ b/init.d/hwclock.in @@ -85,7 +85,7 @@ start() =20 if [ -e /etc/adjtime ] && yesno $clock_adjfile; then _hwclock --adjust $utc_cmd - retval=3D$(($retval + $?)) + : $(( retval +=3D $? )) fi =20 # If setting UTC, don't bother to run hwclock when first booting @@ -99,7 +99,7 @@ start() else _hwclock --systz $utc_cmd $clock_args fi - retval=3D$(($retval + $?)) + : $(( retval +=3D $? )) fi =20 eend $retval "Failed to set the system clock" diff --git a/init.d/keymaps.in b/init.d/keymaps.in index a7bb085..1b96f49 100644 --- a/init.d/keymaps.in +++ b/init.d/keymaps.in @@ -47,7 +47,7 @@ start() n=3D1 while [ $n -le $ttyn ]; do kbd_mode $kmode -C $ttydev$n - n=3D$(($n + 1)) + : $(( n +=3D 1 )) done eend 0 =20 diff --git a/init.d/mixer.in b/init.d/mixer.in index bb42886..a08aea1 100644 --- a/init.d/mixer.in +++ b/init.d/mixer.in @@ -21,7 +21,7 @@ restore() mixer -f "$mixer" \ $(cat "/var/db/${mixer#/dev/}-state") >/dev/null veend $? - : $((retval +=3D $?)) + : $(( retval +=3D $? )) fi done } @@ -40,7 +40,7 @@ stop() vebegin "$mixer" mixer -f "$mixer" -s >/var/db/"${mixer#/dev/}"-state veend $? - : $((retval +=3D $?)) + : $(( retval +=3D $? )) done eoutdent eend $retval diff --git a/init.d/modules.in b/init.d/modules.in index e673763..72f14e7 100644 --- a/init.d/modules.in +++ b/init.d/modules.in @@ -57,7 +57,7 @@ start() [ -z "$args" ] && eval args=3D\$module_${aa}_args [ -z "$args" ] && eval args=3D\$module_${xx}_args eval modprobe -q "$mpargs" "$x" "$args" - eend $? "Failed to load $x" && cnt=3D$(($cnt + 1)) + eend $? "Failed to load $x" && : $(( cnt +=3D 1 )) done einfo "Autoloaded $cnt module(s)" } diff --git a/init.d/moused.in b/init.d/moused.in index a41005f..cdcf36a 100644 --- a/init.d/moused.in +++ b/init.d/moused.in @@ -54,7 +54,7 @@ start() local ttyv=3D for ttyv in /dev/ttyv*; do vidcontrol < "$ttyv" -m on - : $((retval+=3D $?)) + : $(( retval +=3D $? )) done fi =20 diff --git a/init.d/net.lo.in b/init.d/net.lo.in index 66e1945..d647f31 100644 --- a/init.d/net.lo.in +++ b/init.d/net.lo.in @@ -115,7 +115,7 @@ _wait_for_carrier() eend 0 return 0 fi - timeout=3D$((${timeout} - 1)) + : $(( timeout -=3D 1 )) [ "${efunc}" =3D "einfon" ] && printf "." done =20 @@ -144,9 +144,9 @@ _netmask2cidr() local i=3D len=3D local IFS=3D. for i in $1; do - while [ ${i} !=3D "0" ]; do - len=3D$((${len} + ${i} % 2)) - i=3D$((${i} >> 1)) + while [ i -ne 0 ]; do + : $(( len +=3D i % 2 )) + : $(( i >>=3D 1 )) done done =20 @@ -277,7 +277,7 @@ _gen_module_list() echo "module_${i}_program_start=3D'${PROGRAM_START}'" >> "${MODULESLIS= T}" echo "module_${i}_program_stop=3D'${PROGRAM_STOP}'" >> "${MODULESLIST}= " echo "module_${i}_provide=3D'${PROVIDE}'" >> "${MODULESLIST}" - i=3D$((${i} + 1)) + : $(( i +=3D 1 )) done echo "module_${i}=3D" >> "${MODULESLIST}" ) @@ -304,7 +304,7 @@ _load_modules() =20 local i=3D-1 x=3D mod=3D f=3D provides=3D while true; do - i=3D$((${i} + 1)) + : $(( i +=3D 1 )) eval mod=3D\$module_${i} [ -z "${mod}" ] && break [ -e "${MODULESDIR}/${mod}.sh" ] || continue @@ -438,7 +438,7 @@ _load_config() # so modules can influence it for cmd; do eval config_${config_index}=3D"'${cmd}'" - config_index=3D$((${config_index} + 1)) + : $(( config_index +=3D 1 )) done # Terminate the list eval config_${config_index}=3D @@ -446,7 +446,7 @@ _load_config() config_index=3D0 for cmd in ${fallback}; do eval fallback_${config_index}=3D"'${cmd}'" - config_index=3D$((${config_index} + 1)) + : $(( config_index +=3D 1 )) done # Terminate the list eval fallback_${config_index}=3D @@ -541,7 +541,7 @@ start() if [ -n "${our_metric}" ]; then metric=3D${our_metric} elif [ "${IFACE}" !=3D "lo" -a "${IFACE}" !=3D "lo0" ]; then - metric=3D$((${metric} + $(_ifindex))) + : $(( metric +=3D $(_ifindex) )) fi =20 while true; do @@ -581,11 +581,11 @@ start() eindent eval config_${config_index}=3D\$config unset fallback_${config_index} - config_index=3D$((${config_index} - 1)) + : $(( config_index -=3D 1 )) fi fi eoutdent - config_index=3D$((${config_index} + 1)) + : $(( config_index +=3D 1 )) done =20 if ! ${oneworked}; then diff --git a/init.d/network.in b/init.d/network.in index c934129..1c70785 100644 --- a/init.d/network.in +++ b/init.d/network.in @@ -287,7 +287,7 @@ start() tentative || break [ $r =3D 5 ] && vebegin "Waiting for tentative addresses" sleep 1 - r=3D$(($r - 1)) + : $(( r -=3D 1 )) done if [ $r !=3D 5 ]; then [ $r !=3D 0 ] diff --git a/init.d/numlock.in b/init.d/numlock.in index c5b894a..3cb8bee 100644 --- a/init.d/numlock.in +++ b/init.d/numlock.in @@ -21,7 +21,7 @@ _setleds() =20 while [ $i -le $ttyn ]; do setleds -D "$1"num < $dev$i || retval=3D1 - i=3D$(($i + 1)) + : $(( i +=3D 1 )) done =20 return $retval diff --git a/init.d/rc-enabled.in b/init.d/rc-enabled.in index aff2a40..9ba73b0 100644 --- a/init.d/rc-enabled.in +++ b/init.d/rc-enabled.in @@ -33,7 +33,7 @@ start() =20 # Good to go! "$svc" start && started=3D"$started $svc" - : $((retval +=3D $?)) + : $(( retval +=3D $? )) done service_set_value started "$started" eend $retval "Some local rc services failed to start" @@ -46,7 +46,7 @@ stop() local svc=3D retval=3D0 for svc in $(rcorder $(service_get_value started) 2>/dev/null | sort -r= ); do "$svc" stop - : $((retval +=3D $?)) + : $(( retval +=3D $? )) done eend $retval "Some local rc services failed to stop" return 0 diff --git a/init.d/termencoding.in b/init.d/termencoding.in index 68e49b7..edba715 100644 --- a/init.d/termencoding.in +++ b/init.d/termencoding.in @@ -31,7 +31,7 @@ start() n=3D1 while [ ${n} -le "$ttyn" ]; do printf "\033%s" "$termencoding" >$ttydev$n - n=3D$(($n + 1)) + : $(( n +=3D 1 )) done =20 # Save the encoding for use immediately at boot diff --git a/init.d/urandom.in b/init.d/urandom.in index 8233f82..7fe5e59 100644 --- a/init.d/urandom.in +++ b/init.d/urandom.in @@ -16,7 +16,7 @@ save_seed() local psz=3D1 =20 if [ -e /proc/sys/kernel/random/poolsize ]; then - psz=3D$(($(cat /proc/sys/kernel/random/poolsize) / 4096)) + : $(( psz =3D $(cat /proc/sys/kernel/random/poolsize) / 4096 )) fi =20 ( # sub shell to prevent umask pollution diff --git a/man/runscript.8 b/man/runscript.8 index b28bec2..64da26c 100644 --- a/man/runscript.8 +++ b/man/runscript.8 @@ -449,7 +449,7 @@ eat() veinfo "Eating `basename ${food}`" ${command} --eat ${food} retval=3D$? - : $((${result} +=3D ${retval})) + : $(( result +=3D retval )) [ ${retval} =3D 0 ] && ate=3D"${ate} `basename ${food}`" done =20 diff --git a/net/apipa.sh b/net/apipa.sh index 3163104..ae61233 100644 --- a/net/apipa.sh +++ b/net/apipa.sh @@ -26,20 +26,20 @@ apipa_start() eindent =20 while [ ${i} -lt 64516 ]; do - i1=3D$((($(_random) % 255) + 1)) - i2=3D$((($(_random) % 255) + 1)) + : $(( i1 =3D (_random % 255) + 1 )) + : $(( i2 =3D (_random % 255) + 1 )) =20 addr=3D"169.254.${i1}.${i2}" vebegin "${addr}/16" if ! arping_address "${addr}"; then eval config_${config_index}=3D"\"${addr}/16 broadcast 169.254.255.255= \"" - config_index=3D$((${config_index} - 1)) + : $(( config_index -=3D 1 )) veend 0 eoutdent return 0 fi =20 - i=3D$((${i} + 1)) + : $(( i +=3D 1 )) done =20 eerror "No free address found!" diff --git a/net/arping.sh b/net/arping.sh index b77d70c..83360d7 100644 --- a/net/arping.sh +++ b/net/arping.sh @@ -34,7 +34,7 @@ arping_address() while [ ${w} -gt 0 -a -z "${foundmac}" ]; do foundmac=3D"$(arping2 ${opts} -r -c 1 -i "${IFACE}" "${ip}" 2>/dev/nu= ll | \ sed -e 'y/abcdef/ABCDEF/')" - w=3D$((${w} - 1)) + : $(( w -=3D 1 )) done else [ -z "$(_get_inet_address)" ] && opts=3D"${opts} -D" diff --git a/net/clip.sh b/net/clip.sh index 35efa3f..2fc290f 100644 --- a/net/clip.sh +++ b/net/clip.sh @@ -148,7 +148,7 @@ clip_post_start() =20 local nleftretries=3D10 emsg=3D ecode=3D while [ ${nleftretries} -gt 0 ]; do - nleftretries=3D$((${nleftretries} - 1)) + : $(( nleftretries -=3D 1 )) emsg=3D"$(atmarp -s "${peerip}" "${ifvpivci}" "$@" 2>&1)" ecode=3D$? && break sleep 2 diff --git a/net/ifconfig.sh.BSD.in b/net/ifconfig.sh.BSD.in index c0c75f0..15c8fb8 100644 --- a/net/ifconfig.sh.BSD.in +++ b/net/ifconfig.sh.BSD.in @@ -38,7 +38,7 @@ _ifindex() echo "${x#/dev/net}" return 0 fi - i=3D$((${i} + 1)) + : $(( i +=3D 1 )) done ;; default) @@ -47,7 +47,7 @@ _ifindex() echo "${i}" return 0 fi - i=3D$((${i} + 1)) + : $(( i +=3D 1 )) done ;; esac diff --git a/net/ifconfig.sh.Linux.in b/net/ifconfig.sh.Linux.in index a5540c0..dcbd628 100644 --- a/net/ifconfig.sh.Linux.in +++ b/net/ifconfig.sh.Linux.in @@ -26,7 +26,7 @@ _ifindex() { local line=3D i=3D-2 while read line; do - i=3D$((${i} + 1)) + : $(( i +=3D 1 )) [ ${i} -lt 1 ] && continue case "${line}" in "${IFACE}:"*) echo "${i}"; return 0;; @@ -34,7 +34,7 @@ _ifindex() done < /proc/net/dev =20 # Return the next available index - i=3D$((${i} + 1)) + : $(( i +=3D 1 )) echo "${i}" return 1 } @@ -96,7 +96,7 @@ _get_inet_addresses() _exists || break local addr=3D"$(_get_inet_address)" [ -n "${addr}" ] && addrs=3D"${addrs}${addrs:+ }${addr}" - i=3D$((${i} + 1)) + : $(( i +=3D 1 )) done echo "${addrs}" } @@ -106,26 +106,26 @@ _cidr2netmask() local cidr=3D"$1" netmask=3D"" done=3D0 i=3D0 sum=3D0 cur=3D128 local octets=3D frac=3D =20 - local octets=3D$((${cidr} / 8)) - local frac=3D$((${cidr} % 8)) + local octets=3D$(( cidr / 8 )) + local frac=3D$(( cidr % 8 )) while [ ${octets} -gt 0 ]; do netmask=3D"${netmask}.255" - octets=3D$((${octets} - 1)) - done=3D$((${done} + 1)) + : $(( octets -=3D 1 )) + : $(( done +=3D 1 )) done =20 if [ ${done} -lt 4 ]; then while [ ${i} -lt ${frac} ]; do - sum=3D$((${sum} + ${cur})) - cur=3D$((${cur} / 2)) - i=3D$((${i} + 1)) + : $(( sum +=3D cur )) + : $(( cur /=3D 2 )) + : $(( i +=3D 1 )) done netmask=3D"${netmask}.${sum}" - done=3D$((${done} + 1)) + : $(( done +=3D 1 )) =20 while [ ${done} -lt 4 ]; do netmask=3D"${netmask}.0" - done=3D$((${done} + 1)) + : $(( done +=3D 1 )) done fi =20 @@ -150,7 +150,7 @@ _add_address() # Get the last alias made for the interface and add 1 to it i=3D$(ifconfig | sed '1!G;h;$!d' | grep -m 1 -o "^${iface}:[0-9]*" \ | sed -n -e 's/'"${iface}"'://p') - i=3D$((${i:-0} + 1)) + : $(( i =3D ${i:-0} + 1 )) iface=3D"${iface}:${i}" fi =20 diff --git a/net/ifplugd.sh b/net/ifplugd.sh index d048b61..0bcde2f 100644 --- a/net/ifplugd.sh +++ b/net/ifplugd.sh @@ -72,7 +72,7 @@ ifplugd_pre_start() fi sleep 1 [ ${timeout} -eq 0 ] && continue - i=3D$((${i} + 1)) + : $(( i +=3D 1 )) [ ${i} -ge ${timeout} ] && break done =20 diff --git a/net/ip6to4.sh b/net/ip6to4.sh index 0e94293..4564450 100644 --- a/net/ip6to4.sh +++ b/net/ip6to4.sh @@ -51,7 +51,7 @@ ip6to4_start() case "${ip}" in 172.${i}.*) break;; esac - i=3D$((${i} + 1)) + : $(( i +=3D 1 )) done [ ${i} -lt 32 ] && continue ;; @@ -90,7 +90,7 @@ ip6to4_start() =20 # Now apply our config eval config_${config_index}=3D\'"${new}"\' - config_index=3D$((${config_index} - 1)) + : $(( config_index -=3D 1 )) =20 # Add a route for us, ensuring we don't delete anything else local routes=3D"$(_get_array "routes_${IFVAR}") diff --git a/net/iproute2.sh b/net/iproute2.sh index 660d514..91282ea 100644 --- a/net/iproute2.sh +++ b/net/iproute2.sh @@ -36,7 +36,7 @@ _ifindex() { local line=3D i=3D-2 while read line; do - i=3D$((${i} + 1)) + : $(( i +=3D 1 )) [ ${i} -lt 1 ] && continue case "${line}" in "${IFACE}:"*) echo "${i}"; return 0;; @@ -44,7 +44,7 @@ _ifindex() done < /proc/net/dev =20 # Return the next available index - i=3D$((${i} + 1)) + : $(( i +=3D 1 )) echo "${i}" return 1 } @@ -290,7 +290,7 @@ iproute2_post_start() while [ $n -ge 0 ]; do _iproute2_ipv6_tentative || break sleep 1 - n=3D$(($n - 1)) + : $(( n -=3D 1 )) done [ $n -ge 0 ] eend $? diff --git a/net/iwconfig.sh.BSD.in b/net/iwconfig.sh.BSD.in index 850d70b..3acaf66 100644 --- a/net/iwconfig.sh.BSD.in +++ b/net/iwconfig.sh.BSD.in @@ -218,7 +218,7 @@ iwconfig_associate() sleep 1 =20 [ ${timeout} -eq 0 ] && continue - i=3D$((${i} + 1)) + : $(( i +=3D 1 )) [ ${i} -ge ${timeout} ] && { eend 1; return 1; } done =20 @@ -252,13 +252,13 @@ iwconfig_scan() scan=3D"$(LC_ALL=3DC ifconfig -v "${IFACE}" list scan 2>/dev/null | sed= -e "1 d" -e "s/$/'/g" -e "s/^/'/g")" while [ ${i} -lt 3 -a -z "${scan}" ] ; do scan=3D"${scan}${scan:+ }$(LC_ALL=3DC ifconfig -v "${IFACE}" scan 2>/d= ev/null | sed -e "1 d" -e "s/$/'/g" -e "s/^/'/g")" - i=3D$((${i} + 1)) + : $(( i +=3D 1 )) done =20 APS=3D-1 eval set -- ${scan} for line in "$@" ; do - APS=3D$((${APS} + 1)) + : $(( APS +=3D 1 )) set -- ${line} while true ; do case "$1" in @@ -276,7 +276,7 @@ iwconfig_scan() # Add 1000 for managed nodes as we prefer them to adhoc set -- $* case "$1" in - *E*) eval QUAL_${APS}=3D$((${quality} + 1000)) ;; + *E*) eval QUAL_${APS}=3D$(( quality + 1000 )) ;; *) eval QUAL_${APS}=3D\$quality ;; esac done @@ -290,7 +290,7 @@ iwconfig_scan() # Sort based on quality local i=3D0 k=3D1 a=3D b=3D x=3D t=3D while [ ${i} -lt ${APS} ] ; do - k=3D$((${i} + 1)) + : $(( k =3D i + 1 )) while [ ${k} -le ${APS} ] ; do eval a=3D\$QUALITY_${i} [ -z "${a}" ] && break @@ -302,15 +302,15 @@ iwconfig_scan() eval ${x}_${k}=3D\$t done fi - k=3D$((${k} + 1)) + : $(( k +=3D 1 )) done - i=3D$((${i} + 1)) + : $(( i +=3D 1 )) done =20 # Strip any duplicates local i=3D0 k=3D1 a=3D b=3D while [ ${i} -lt ${APS} ] ; do - k=3D$((${i} + 1)) + : $(( k =3D i + 1 )) while [ ${k} -le ${APS} ] ; do eval a=3D\$MAC_${i} eval b=3D\$MAC_${k} @@ -327,9 +327,9 @@ iwconfig_scan() unset MAC_${k} SSID_${k} CHAN_${k} QUALITY_${k} CAPS_${k} fi fi - k=3D$((${k} + 1)) + : $(( k +=3D 1 )) done - i=3D$((${i} + 1)) + : $(( i +=3D 1 )) done =20 local i=3D0 e=3D m=3D s=3D @@ -337,7 +337,7 @@ iwconfig_scan() while [ ${i} -le ${APS} ] ; do eval x=3D\$MAC_${i} if [ -z "${x}" ] ; then - i=3D$((${i} + 1)) + : $(( i +=3D 1 )) continue fi =20 @@ -374,7 +374,7 @@ iwconfig_scan() unset SSID_${i} MAC_${i} CHAN_${i} QUALITY_${i} CAPS_${i} fi done - i=3D$((${i} + 1)) + : $(( i +=3D 1 )) done eoutdent return 0 @@ -396,7 +396,7 @@ iwconfig_force_preferred() found_AP=3Dtrue break fi - i=3D$((${i} + 1)) + : $(( i +=3D 1 )) done if ! ${found_AP} ; then SSID=3D${ssid} @@ -428,7 +428,7 @@ iwconfig_connect_preferred() iwconfig_associate "${mac}" \ "${chan}" "${caps}" && return 0 fi - i=3D$((${i} + 1)) + : $(( i +=3D 1 )) done done =20 @@ -442,7 +442,7 @@ iwconfig_connect_not_preferred() while [ ${i} -le ${APS} ] ; do eval e=3D\$SSID_${i} if [ -z "${e}" ] ; then - i=3D$((${i} + 1)) + : $(( i +=3D 1 )) continue fi =20 @@ -465,7 +465,7 @@ iwconfig_connect_not_preferred() iwconfig_associate "${mac}" \ "${chan}" "${caps}" && return 0 fi - i=3D$((${i} + 1)) + : $(( i +=3D 1 )) done =20 return 1 diff --git a/net/iwconfig.sh.Linux.in b/net/iwconfig.sh.Linux.in index 199678f..293bc1f 100644 --- a/net/iwconfig.sh.Linux.in +++ b/net/iwconfig.sh.Linux.in @@ -39,7 +39,7 @@ _get_ssid() return 0 fi sleep 1 - i=3D$((${i} - 1)) + : $(( i -=3D 1 )) done =20 return 1 @@ -229,7 +229,7 @@ iwconfig_wait_for_association() =20 sleep 1 [ ${timeout} -eq 0 ] && continue - i=3D$((${i} + 1)) + : $(( i +=3D 1 )) [ ${i} -ge ${timeout} ] && return 1 done return 1 @@ -347,7 +347,7 @@ iwconfig_scan() ;; esac fi - i=3D$((${i} + 1)) + : $(( i +=3D 1 )) done =20 if [ -z "${scan}" ]; then @@ -377,7 +377,7 @@ iwconfig_scan() for line; do case "${line}" in *Address:*) - APS=3D$((${APS} + 1)) + : $(( APS +=3D 1 )) eval MAC_${APS}=3D"\""$(echo "${line#*: }" | tr '[:lower:]' '[:upper= :]')"\"" eval QUALITY_${APS}=3D0 ;; @@ -427,7 +427,7 @@ iwconfig_scan() # Sort based on quality local i=3D0 k=3D1 a=3D b=3D x=3D t=3D while [ ${i} -lt ${APS} ]; do - k=3D$((${i} + 1)) + : $(( k =3D i + 1 )) while [ ${k} -le ${APS} ]; do eval a=3D\$QUALITY_${i} [ -z "${a}" ] && break @@ -439,15 +439,15 @@ iwconfig_scan() eval ${x}_${k}=3D\$t done fi - k=3D$((${k} + 1)) + : $(( k +=3D 1 )) done - i=3D$((${i} + 1)) + : $(( i +=3D 1 )) done =20 # Strip any duplicates local i=3D0 k=3D1 a=3D b=3D while [ ${i} -lt ${APS} ]; do - k=3D$((${i} + 1)) + : $(( k =3D i + 1 )) while [ ${k} -le ${APS} ]; do eval a=3D\$MAC_${i} eval b=3D\$MAC_${k} @@ -459,9 +459,9 @@ iwconfig_scan() [ -n "${a}" -a -n "${b}" ] && [ "${a}" -lt "${b}" ] && u=3D${i} unset MAC_${u} SSID_${u} MODE_${u} CHAN_${u} QUALITY_${u} ENC_${u} fi - k=3D$((${k} + 1)) + : $(( k +=3D 1 )) done - i=3D$((${i} + 1)) + : $(( i +=3D 1 )) done =20 local i=3D0 e=3D m=3D s=3D @@ -469,7 +469,7 @@ iwconfig_scan() while [ ${i} -le ${APS} ]; do eval x=3D\$MAC_${i} if [ -z "${x}" ]; then - i=3D$((${i} + 1)) + : $(( i +=3D 1 )) continue fi =20 @@ -506,7 +506,7 @@ iwconfig_scan() unset SSID_${i} MAC_${i} ${MODE}_${i} CHAN_${i} QUALITY_${i} ENC_${i= } fi done - i=3D$((${i} + 1)) + : $(( i +=3D 1 )) done eoutdent } @@ -526,7 +526,7 @@ iwconfig_force_preferred() found_AP=3Dtrue break fi - i=3D$((${i} + 1)) + : $(( i +=3D 1 )) done if ! ${found_AP}; then SSID=3D${ssid} @@ -559,7 +559,7 @@ iwconfig_connect_preferred() iwconfig_associate "${mode}" "${mac}" "${enc}" "${freq}" \ "${chan}" && return 0 fi - i=3D$((${i} + 1)) + : $(( i +=3D 1 )) done done =20 @@ -593,7 +593,7 @@ iwconfig_connect_not_preferred() "${chan}" && return 0 fi fi - i=3D$((${i} + 1)) + : $(( i +=3D 1 )) done =20 return 1 diff --git a/net/netplugd.sh b/net/netplugd.sh index f7df7a3..f43a5e6 100644 --- a/net/netplugd.sh +++ b/net/netplugd.sh @@ -74,7 +74,7 @@ netplugd_pre_start() fi sleep 1 [ ${timeout} -eq 0 ] && continue - i=3D$((${i} + 1)) + : $(( i +=3D 1 )) [ ${i} -ge ${timeout} ] && break done =20 diff --git a/net/pppd.sh b/net/pppd.sh index 1f9d302..97bd3ee 100644 --- a/net/pppd.sh +++ b/net/pppd.sh @@ -96,7 +96,7 @@ pppd_pre_start() if ! ${hasdefaultmetric}; then local m=3D eval m=3D\$metric_${IFVAR} - [ -z "${m}" ] && m=3D$((${metric} + $(_ifindex))) + [ -z "${m}" ] && : $(( m =3D metric + $(_ifindex) )) opts=3D"${opts} defaultmetric ${m}" fi if [ -n "${mtu}" ]; then diff --git a/net/tuntap.sh b/net/tuntap.sh index 884e0ab..ac505ab 100644 --- a/net/tuntap.sh +++ b/net/tuntap.sh @@ -30,7 +30,7 @@ tuntap_pre_start() local timeout=3D10 while [ ! -e /dev/net/tun -a ${timeout} -gt 0 ]; do sleep 1 - timeout=3D$((${timeout} - 1)) + : $(( timeout -=3D 1 )) done if [ ! -e /dev/net/tun ]; then eerror "TUN/TAP support present but /dev/net/tun is not" diff --git a/net/wpa_supplicant.sh b/net/wpa_supplicant.sh index 91de49e..53b0256 100644 --- a/net/wpa_supplicant.sh +++ b/net/wpa_supplicant.sh @@ -34,7 +34,7 @@ _get_ssid() return 0 fi sleep 1 - timeout=3D$((timeout - 1)) + : $(( timeout -=3D 1 )) done =20 return 1 diff --git a/sh/functions.sh.in b/sh/functions.sh.in index 1d1b0cd..b00ec68 100644 --- a/sh/functions.sh.in +++ b/sh/functions.sh.in @@ -8,14 +8,14 @@ RC_GOT_FUNCTIONS=3D"yes" =20 eindent() { - EINFO_INDENT=3D$((${EINFO_INDENT:-0} + 2)) + : $(( EINFO_INDENT =3D ${EINFO_INDENT:-0} + 2 )) [ "$EINFO_INDENT" -gt 40 ] && EINFO_INDENT=3D40 export EINFO_INDENT } =20 eoutdent() { - EINFO_INDENT=3D$((${EINFO_INDENT:-0} - 2)) + : $(( EINFO_INDENT =3D ${EINFO_INDENT:-0} - 2 )) [ "$EINFO_INDENT" -lt 0 ] && EINFO_INDENT=3D0 return 0 } diff --git a/sh/rc-mount.sh b/sh/rc-mount.sh index b3c9bf6..2bb1450 100644 --- a/sh/rc-mount.sh +++ b/sh/rc-mount.sh @@ -59,7 +59,7 @@ do_unmount() eend 1 else local sig=3D"TERM" - retry=3D$(($retry - 1)) + : $(( retry -=3D 1 )) [ $retry =3D 1 ] && sig=3D"KILL" fuser $f_kill$sig -k $f_opts \ "$mnt" >/dev/null 2>&1 diff --git a/sh/runtests.sh b/sh/runtests.sh index 7f7e7bd..f083ff4 100755 --- a/sh/runtests.sh +++ b/sh/runtests.sh @@ -9,17 +9,17 @@ tret=3D0 ebegin "Testing yesno()" for f in yes YES Yes true TRUE True 1 ; do if ! yesno $f; then - tret=3D$(($tret + 1)) + : $(( tret +=3D 1 )) echo "!$f!" fi done for f in no NO No false FALSE False 0 ; do if yesno $f; then - tret=3D$(($tret + 1)) + : $(( tret +=3D 1 )) echo "!$f!" fi done eend $tret -ret=3D$(($ret + $tret)) +: $(( ret +=3D $tret )) =20 exit $ret diff --git a/src/test/runtests.sh b/src/test/runtests.sh index 4731bd7..a4b3f18 100755 --- a/src/test/runtests.sh +++ b/src/test/runtests.sh @@ -15,7 +15,7 @@ checkit() { echo "$@" | tr ' ' '\n' > ${base}.out diff -u ${base}.list ${base}.out eend $? - ret=3D$(($ret + $?)) + : $(( ret +=3D $? )) } =20 ret=3D0 @@ -65,7 +65,7 @@ readelf -Wr $(grep -l '#include[[:space:]]"librc\.h"' $= {librc_srcdir}/*.c | sed syms=3D$(diff -u librc.funcs.hidden.list librc.funcs.hidden.out | sed -n= '/^+[^+]/s:^+::p') [ -z "${syms}" ] eend $? "Missing hidden defs:"$'\n'"${syms}" -ret=3D$(($ret + $?)) +: $(( ret +=3D $? )) =20 ebegin "Checking trailing whitespace in code" # XXX: Should we check man pages too ? @@ -118,7 +118,7 @@ for u in units/*; do ebegin "$(basename "${u}")" ./"${u}" eend $? - ret=3D$(($ret + $?)) + : $(( ret +=3D $? )) done =20 exit ${ret} diff --git a/support/openvpn/up.sh b/support/openvpn/up.sh index 1456932..c52ea04 100755 --- a/support/openvpn/up.sh +++ b/support/openvpn/up.sh @@ -34,7 +34,7 @@ while true; do elif [ "${opt}" !=3D "${opt#dhcp-option DNS *}" ]; then NS=3D"${NS}nameserver ${opt#dhcp-option DNS *}\n" fi - i=3D$((${i} + 1)) + : $(( i +=3D 1 )) done =20 if [ -n "${NS}" ]; then