Fix trying to emerge an empty list of packages. (Bug 213294)
authorfuzzyray <fuzzyray@gentoo.org>
Thu, 13 Mar 2008 19:34:23 +0000 (19:34 -0000)
committerfuzzyray <fuzzyray@gentoo.org>
Thu, 13 Mar 2008 19:34:23 +0000 (19:34 -0000)
svn path=/; revision=479

trunk/ChangeLog
trunk/src/revdep-rebuild/revdep-rebuild

index 1c9408606a54e34c1403f68cf34e990ef15d1676..3996886b49549d0dfa9aa4357b1abaa4e6b3e4f6 100644 (file)
@@ -1,3 +1,7 @@
+2008-03-13: Paul Varner <fuzzyray@gentoo.org>
+       * revdep-rebuild: Fix trying to emerge an empty list of packages. (Bug
+       213294)
+
 2008-02-28: Paul Varner <fuzzyray@gentoo.org>
        * gentoolkit: Fix traceback when accessing the portage
        db. (Bug #211716)
index 8c65e262774ecffa9bb97d958afd1466aae7f7d2..282dee5cac272fd5c2eccc855669ea31c466c851 100755 (executable)
@@ -841,18 +841,25 @@ get_build_order() {
                RAW_REBUILD_LIST=$(<"$LIST.4_ebuilds")
                if [[ $RAW_REBUILD_LIST ]]; then
                        export EMERGE_DEFAULT_OPTS="--nospinner --pretend --oneshot --quiet"
-                       RAW_REBUILD_LIST=($RAW_REBUILD_LIST)
+                       RAW_REBUILD_LIST=($RAW_REBUILD_LIST) # convert into array
                        # If PACKAGE_NAMES is defined we're using slots, not versions
                        if [[ $PACKAGE_NAMES ]]; then
                                # Eliminate atoms that can't be built
-                               for (( i=0; i<${#RAW_REBUILD_LIST[@]}; i++ )); do
-                                       portageq best_visible "$PORTAGE_ROOT" "${RAW_REBUILD_LIST[i]}" >/dev/null && continue
-                                       SKIP_LIST+=("${RAW_REBUILD_LIST[i]}")
+                               for i in "${!RAW_REBUILD_LIST[@]}"; do
+                                       if [[ "${RAW_REBUILD_LIST[i]}" = *[A-Za-z]* ]]; then
+                                               portageq best_visible "$PORTAGE_ROOT" "${RAW_REBUILD_LIST[i]}" >/dev/null && continue
+                                               SKIP_LIST+=("${RAW_REBUILD_LIST[i]}")
+                                       fi
                                        unset RAW_REBUILD_LIST[i]
                                done
                                # If RAW_REBUILD_LIST is empty, then we have nothing to build.
                                if (( ${#RAW_REBUILD_LIST[@]} == 0 )); then
-                                       list_skipped_packages
+                                       if (( ${#SKIP_LIST[@]} == 0 )); then
+                                               ewarn "The list of packages to skip is empty, but there are no"
+                                               ewarn "packages listed to rebuild either. This is a bug."
+                                       else
+                                               list_skipped_packages
+                                       fi
                                        die 1 'Warning: Portage cannot rebuild any of the necessary packages.'
                                fi
                        else