best/has_version: --host-root first arg only
authorZac Medico <zmedico@gentoo.org>
Sat, 8 Sep 2012 16:15:39 +0000 (09:15 -0700)
committerZac Medico <zmedico@gentoo.org>
Sat, 8 Sep 2012 16:15:39 +0000 (09:15 -0700)
bin/phase-helpers.sh

index 0587991f990613414777bc5be90a053b6f8e41e3..18877f059c4a8512fcf1ae9e2e064ce23ab406c0 100644 (file)
@@ -656,18 +656,13 @@ _eapi5_apply_user_patches() {
 has_version() {
 
        local atom eroot host_root=false root=${ROOT}
-       while [ $# -gt 0 ] ; do
-               case "$1" in
-                       --host-root)
-                               host_root=true
-                               ;;
-                       *)
-                               [[ -n ${atom} ]] && die "${FUNCNAME[0]}: unused argument: $1"
-                               atom=$1
-                               ;;
-               esac
+       if [[ $1 == --host-root ]] ; then
+               host_root=true
                shift
-       done
+       fi
+       atom=$1
+       shift
+       [ $# -gt 0 ] && die "${FUNCNAME[0]}: unused argument(s): $*"
 
        if ${host_root} ; then
                case "${EAPI}" in
@@ -713,18 +708,13 @@ has_version() {
 best_version() {
 
        local atom eroot host_root=false root=${ROOT}
-       while [ $# -gt 0 ] ; do
-               case "$1" in
-                       --host-root)
-                               host_root=true
-                               ;;
-                       *)
-                               [[ -n ${atom} ]] && die "${FUNCNAME[0]}: unused argument: $1"
-                               atom=$1
-                               ;;
-               esac
+       if [[ $1 == --host-root ]] ; then
+               host_root=true
                shift
-       done
+       fi
+       atom=$1
+       shift
+       [ $# -gt 0 ] && die "${FUNCNAME[0]}: unused argument(s): $*"
 
        if ${host_root} ; then
                case "${EAPI}" in