eclean/test_clean: remove unused test_test_support import
[gentoolkit.git] / bin / revdep-rebuild.sh
index abeed6b0ef99c206f2e3804a11be1c4543ec7b0c..1d27d63a5b8450f83f1132d1b215c3a8ab3f6df3 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
@@ -180,9 +180,9 @@ Broken reverse dependency rebuilder.
   -h, --help           Print this usage
   -i, --ignore         Ignore temporary files from previous runs
   -k, --keep-temp      Do not delete temporary files on exit
-  -L, --library NAME   Emerge existing packages that use the library with NAME
-      --library=NAME   NAME can be a full path to the library or a basic
-                       regular expression (man grep)
+  -L, --library NAME   Unconditionally emerge existing packages that use the
+      --library=NAME   library with NAME. NAME can be a full path to the
+                       library or a basic regular expression (man grep)
   -l, --no-ld-path     Do not set LD_LIBRARY_PATH
   -o, --no-order       Do not check the build order
                        (Saves time, but may cause breakage.)
@@ -1151,42 +1151,45 @@ rebuild() {
 ##
 # Finish up
 cleanup() {
-       if [[ (( $(<"$STATUS_FILE") != 0 )) && ! is_real_merge ]]; then
-               ewarn
-               ewarn "$APP_NAME failed to emerge all packages."
-               ewarn 'you have the following choices:'
-               einfo "- If emerge failed during the build, fix the problems and re-run $APP_NAME."
-               einfo '- Use /etc/portage/package.keywords to unmask a newer version of the package.'
-               einfo "  (and remove $ORDER_FILE to be evaluated again)"
-               einfo '- Modify the above emerge command and run it manually.'
-               einfo '- Compile or unmerge unsatisfied packages manually,'
-               einfo '  remove temporary files, and try again.'
-               einfo '  (you can edit package/ebuild list first)'
-               einfo
-               einfo 'To remove temporary files, please run:'
-               einfo "rm ${WORKING_DIR}/*.rr"
-               show_unowned_files
-               exit $EMERGE_STATUS
-       elif is_real_merge; then
-               trap_cmd() {
-                       eerror "terminated. Please remove the temporary files manually:"
-                       eerror "rm ${WORKING_DIR}/*.rr"
-                       exit 1
-               }
-               [[ "${SKIP_LIST[@]}" != "" ]] && list_skipped_packages
-               trap trap_cmd SIGHUP SIGINT SIGQUIT SIGABRT SIGTERM
-               einfo 'Build finished correctly. Removing temporary files...'
-               einfo
-               einfo 'You can re-run revdep-rebuild to verify that all libraries and binaries'
-               einfo 'are fixed. Possible reasons for remaining inconsistencies include:'
-               einfo '  orphaned files'
-               einfo '  deep dependencies'
-               einfo "  packages installed outside of portage's control"
-               einfo '  specially-evaluated libraries'
-               if [[ -r "$OWNERS_FILE" && -s "$OWNERS_FILE" ]]; then
+       EMERGE_STATUS=$(<"$STATUS_FILE")
+       if is_real_merge; then
+               if [[ (( $EMERGE_STATUS != 0 )) ]]; then
+                       ewarn
+                       ewarn "$APP_NAME failed to emerge all packages."
+                       ewarn 'you have the following choices:'
+                       einfo "- If emerge failed during the build, fix the problems and re-run $APP_NAME."
+                       einfo '- Use /etc/portage/package.keywords to unmask a newer version of the package.'
+                       einfo "  (and remove $ORDER_FILE to be evaluated again)"
+                       einfo '- Modify the above emerge command and run it manually.'
+                       einfo '- Compile or unmerge unsatisfied packages manually,'
+                       einfo '  remove temporary files, and try again.'
+                       einfo '  (you can edit package/ebuild list first)'
+                       einfo
+                       einfo 'To remove temporary files, please run:'
+                       einfo "rm ${WORKING_DIR}/*.rr"
                        show_unowned_files
+                       exit $EMERGE_STATUS
+               else
+                       trap_cmd() {
+                               eerror "terminated. Please remove the temporary files manually:"
+                               eerror "rm ${WORKING_DIR}/*.rr"
+                               exit 1
+                       }
+                       [[ "${SKIP_LIST[@]}" != "" ]] && list_skipped_packages
+                       trap trap_cmd SIGHUP SIGINT SIGQUIT SIGABRT SIGTERM
+                       einfo 'Build finished correctly. Removing temporary files...'
+                       einfo
+                       einfo 'You can re-run revdep-rebuild to verify that all libraries and binaries'
+                       einfo 'are fixed. Possible reasons for remaining inconsistencies include:'
+                       einfo '  orphaned files'
+                       einfo '  deep dependencies'
+                       einfo "  packages installed outside of portage's control"
+                       einfo '  specially-evaluated libraries'
+                       if [[ -r "$OWNERS_FILE" && -s "$OWNERS_FILE" ]]; then
+                               show_unowned_files
+                       fi
+                       [[ $KEEP_TEMP ]] || rm -f "${FILES[@]}"
                fi
-               [[ $KEEP_TEMP ]] || rm -f "${FILES[@]}"
        else
                einfo 'Now you can remove -p (or --pretend) from arguments and re-run revdep-rebuild.'
        fi