Fix revdep-rebuiild to exit correctly with correct error code when emerge
authorPaul Varner <fuzzyray@gentoo.org>
Wed, 12 Oct 2011 16:34:47 +0000 (11:34 -0500)
committerPaul Varner <fuzzyray@gentoo.org>
Wed, 12 Oct 2011 16:34:47 +0000 (11:34 -0500)
fails. Bug 351054

bin/revdep-rebuild.sh

index abeed6b0ef99c206f2e3804a11be1c4543ec7b0c..538e101185875641354d75f8d76925d11194131a 100755 (executable)
@@ -18,7 +18,7 @@ unset GREP_OPTIONS
 
 # Readonly variables:
 declare -r APP_NAME="revdep-rebuild" # # The name of this application
-declare -r VERSION="svn"
+declare -r VERSION="vcs"
 declare -r OIFS="$IFS"         # Save the IFS
 declare -r     ENV_FILE=0_env.rr     # Contains environment variables
 declare -r   FILES_FILE=1_files.rr   # Contains a list of files to search
@@ -1151,7 +1151,8 @@ rebuild() {
 ##
 # Finish up
 cleanup() {
-       if [[ (( $(<"$STATUS_FILE") != 0 )) && ! is_real_merge ]]; then
+       EMERGE_STATUS=$(<"$STATUS_FILE")
+       if [[ (( $EMERGE_STATUS != 0 )) && is_real_merge ]]; then
                ewarn
                ewarn "$APP_NAME failed to emerge all packages."
                ewarn 'you have the following choices:'