Simplify retval checks in has_version() and best_version().
authorMichał Górny <mgorny@gentoo.org>
Sun, 24 Oct 2010 08:58:59 +0000 (10:58 +0200)
committerZac Medico <zmedico@gentoo.org>
Wed, 27 Oct 2010 14:37:18 +0000 (07:37 -0700)
bin/ebuild.sh

index c7f81c50e544488b4ab2397416027a6db5a30da5..e67dd6366db40a0cbb11620877f026c5f116a3a4 100755 (executable)
@@ -188,11 +188,8 @@ has_version() {
        fi
        local retval=$?
        case "${retval}" in
-               0)
-                       return 0
-                       ;;
-               1)
-                       return 1
+               0|1)
+                       return ${retval}
                        ;;
                *)
                        die "unexpected portageq exit code: ${retval}"
@@ -230,11 +227,8 @@ best_version() {
        fi
        local retval=$?
        case "${retval}" in
-               0)
-                       return 0
-                       ;;
-               1)
-                       return 1
+               0|1)
+                       return ${retval}
                        ;;
                *)
                        die "unexpected portageq exit code: ${retval}"