For bug #180165, make has_version dir if portageq has an unexpected exit code.
authorZac Medico <zmedico@gentoo.org>
Wed, 20 Jun 2007 00:17:17 +0000 (00:17 -0000)
committerZac Medico <zmedico@gentoo.org>
Wed, 20 Jun 2007 00:17:17 +0000 (00:17 -0000)
svn path=/main/trunk/; revision=6882

bin/ebuild.sh

index 164b2a0df6bc71fd995366d3dc5d6e50efb9b8dc..ffe904e9cfe10d7e6154fd112d946ee4fdadcf6e 100755 (executable)
@@ -182,11 +182,19 @@ has_version() {
        fi
        # return shell-true/shell-false if exists.
        # Takes single depend-type atoms.
-       if "${PORTAGE_BIN_PATH}/portageq" 'has_version' "${ROOT}" "$1"; then
-               return 0
-       else
-               return 1
-       fi
+       "${PORTAGE_BIN_PATH}"/portageq has_version "${ROOT}" "$1"
+       local retval=$?
+       case "${retval}" in
+               0)
+                       return 0
+                       ;;
+               1)
+                       return 1
+                       ;;
+               *)
+                       die "unexpected portageq exit code: ${retval}"
+                       ;;
+       esac
 }
 
 portageq() {