From d60e4ffb4b1f9a24dbb97cca9409affced854008 Mon Sep 17 00:00:00 2001 From: Zac Medico Date: Thu, 30 Apr 2009 06:45:51 +0000 Subject: [PATCH] In order to eliminate the possibility of integer overflay, replace things like ((ret+=$?)) with ((ret|=$?)). Thanks to zong_sharo for the suggestion. (trunk r13242) svn path=/main/branches/2.1.6/; revision=13423 --- bin/ebuild-helpers/dobin | 2 +- bin/ebuild-helpers/dodoc | 2 +- bin/ebuild-helpers/doexe | 2 +- bin/ebuild-helpers/doins | 4 ++-- bin/ebuild-helpers/dolib | 2 +- bin/ebuild-helpers/doman | 6 +++--- bin/ebuild-helpers/domo | 2 +- bin/ebuild-helpers/dosbin | 2 +- bin/ebuild-helpers/dosed | 4 ++-- bin/ebuild-helpers/ecompress | 2 +- bin/ebuild-helpers/ecompressdir | 4 ++-- bin/ebuild-helpers/prepallman | 2 +- 12 files changed, 17 insertions(+), 17 deletions(-) diff --git a/bin/ebuild-helpers/dobin b/bin/ebuild-helpers/dobin index 958a37fee..87b773f83 100755 --- a/bin/ebuild-helpers/dobin +++ b/bin/ebuild-helpers/dobin @@ -23,7 +23,7 @@ for x in "$@" ; do echo "!!! ${0##*/}: $x does not exist" 1>&2 false fi - ((ret+=$?)) + ((ret|=$?)) done exit ${ret} diff --git a/bin/ebuild-helpers/dodoc b/bin/ebuild-helpers/dodoc index adf49d04f..042757037 100755 --- a/bin/ebuild-helpers/dodoc +++ b/bin/ebuild-helpers/dodoc @@ -21,7 +21,7 @@ for x in "$@" ; do ecompress --queue "${dir}/${x##*/}" elif [ ! -e "${x}" ] ; then echo "!!! ${0##*/}: $x does not exist" 1>&2 - ((++ret)) + ((ret|=1)) fi done diff --git a/bin/ebuild-helpers/doexe b/bin/ebuild-helpers/doexe index a6d679d07..00f43d0c4 100755 --- a/bin/ebuild-helpers/doexe +++ b/bin/ebuild-helpers/doexe @@ -35,7 +35,7 @@ for x in "$@" ; do echo "!!! ${0##*/}: $mysrc does not exist" 1>&2 false fi - ((ret+=$?)) + ((ret|=$?)) done rm -rf "$TMP" diff --git a/bin/ebuild-helpers/doins b/bin/ebuild-helpers/doins index 8c06bfd9a..82f0bf3b6 100755 --- a/bin/ebuild-helpers/doins +++ b/bin/ebuild-helpers/doins @@ -89,9 +89,9 @@ for x in "$@" ; do mv "$TMP/1/$x_orig" "$x" fi while popd >/dev/null 2>&1 ; do true ; done - ((++success)) + ((success|=1)) else - _doins "${x}" && ((++success)) + _doins "${x}" && ((success|=1)) fi done rm -rf "$TMP" diff --git a/bin/ebuild-helpers/dolib b/bin/ebuild-helpers/dolib index 6c6628bda..a158ecc04 100755 --- a/bin/ebuild-helpers/dolib +++ b/bin/ebuild-helpers/dolib @@ -35,7 +35,7 @@ for x in "$@" ; do echo "!!! ${0##*/}: ${x} does not exist" 1>&2 false fi - ((ret+=$?)) + ((ret|=$?)) done exit ${ret} diff --git a/bin/ebuild-helpers/doman b/bin/ebuild-helpers/doman index 48abc39fd..eb1f3114e 100755 --- a/bin/ebuild-helpers/doman +++ b/bin/ebuild-helpers/doman @@ -48,14 +48,14 @@ for x in "$@" ; do fi install -m0644 "${x}" "${D}/usr/share/man/${mandir}/${name}" - ((ret+=$?)) + ((ret|=$?)) elif [[ ! -e ${x} ]] ; then echo "!!! ${0##*/}: $x does not exist" 1>&2 - ((++ret)) + ((ret|=1)) fi else vecho "doman: '${x}' is probably not a man page; skipping" 1>&2 - ((++ret)) + ((ret|=1)) fi done diff --git a/bin/ebuild-helpers/domo b/bin/ebuild-helpers/domo index f2ad3eaea..88570c69a 100755 --- a/bin/ebuild-helpers/domo +++ b/bin/ebuild-helpers/domo @@ -26,7 +26,7 @@ for x in "$@" ; do echo "!!! ${0##*/}: $x does not exist" 1>&2 false fi - ((ret+=$?)) + ((ret|=$?)) done exit $ret diff --git a/bin/ebuild-helpers/dosbin b/bin/ebuild-helpers/dosbin index c9e85c0b8..e850701e7 100755 --- a/bin/ebuild-helpers/dosbin +++ b/bin/ebuild-helpers/dosbin @@ -21,7 +21,7 @@ for x in "$@" ; do echo "!!! ${0##*/}: ${x} does not exist" 1>&2 false fi - ((ret+=$?)) + ((ret|=$?)) done exit ${ret} diff --git a/bin/ebuild-helpers/dosed b/bin/ebuild-helpers/dosed index abcb15a79..0510703fa 100755 --- a/bin/ebuild-helpers/dosed +++ b/bin/ebuild-helpers/dosed @@ -22,7 +22,7 @@ for x in "$@" ; do echo "${y} is not a regular file!" >&2 false fi - ((ret+=$?)) + ((ret|=$?)) else mysed="${x}" fi @@ -30,7 +30,7 @@ done if [ $file_found = 0 ] ; then echo "!!! ${0##*/}: $y does not exist" 1>&2 - ((ret+=1)) + ((ret|=1)) fi exit $ret diff --git a/bin/ebuild-helpers/ecompress b/bin/ebuild-helpers/ecompress index 6fdde5719..8b4fb98a3 100755 --- a/bin/ebuild-helpers/ecompress +++ b/bin/ebuild-helpers/ecompress @@ -75,7 +75,7 @@ case $1 in for x in "$@" ; do [[ ${x##*.} =~ $mask_ext_re ]] && continue filtered_args[$i]=$x - (( i++ )) + ((i|=1)) done [ $i -eq 0 ] && exit 0 set -- "${filtered_args[@]}" diff --git a/bin/ebuild-helpers/ecompressdir b/bin/ebuild-helpers/ecompressdir index 4dd35e549..297b46777 100755 --- a/bin/ebuild-helpers/ecompressdir +++ b/bin/ebuild-helpers/ecompressdir @@ -54,7 +54,7 @@ funk_up_dir() { # first we act on all the files find "${dir}" -type f ${negate} -iname '*'${suffix} -print0 | ${XARGS} -0 ${binary} - ((ret+=$?)) + ((ret|=$?)) find "${dir}" -type l -print0 | \ while read -d $'\0' brokenlink ; do @@ -67,7 +67,7 @@ funk_up_dir() { [[ ${act} == "compress" ]] \ && ln -snf "${newdest}" "${brokenlink}${suffix}" \ || ln -snf "${newdest}" "${brokenlink%${suffix}}" - ((ret+=$?)) + ((ret|=$?)) done } diff --git a/bin/ebuild-helpers/prepallman b/bin/ebuild-helpers/prepallman index 747ed1fac..c9e1bdf4a 100755 --- a/bin/ebuild-helpers/prepallman +++ b/bin/ebuild-helpers/prepallman @@ -11,7 +11,7 @@ find "${D}" -type d -name man > "${T}"/prepallman.filelist while read mandir ; do mandir=${mandir#${D}} prepman "${mandir%/man}" - ((ret+=$?)) + ((ret|=$?)) done < "${T}"/prepallman.filelist exit ${ret} -- 2.26.2