From f102a9aeee3b81ae9069ecde5051920f892d7d0a Mon Sep 17 00:00:00 2001 From: fuzzyray Date: Thu, 13 Mar 2008 19:34:23 +0000 Subject: [PATCH] Fix trying to emerge an empty list of packages. (Bug 213294) svn path=/; revision=479 --- trunk/ChangeLog | 4 ++++ trunk/src/revdep-rebuild/revdep-rebuild | 17 ++++++++++++----- 2 files changed, 16 insertions(+), 5 deletions(-) diff --git a/trunk/ChangeLog b/trunk/ChangeLog index 1c94086..3996886 100644 --- a/trunk/ChangeLog +++ b/trunk/ChangeLog @@ -1,3 +1,7 @@ +2008-03-13: Paul Varner + * revdep-rebuild: Fix trying to emerge an empty list of packages. (Bug + 213294) + 2008-02-28: Paul Varner * gentoolkit: Fix traceback when accessing the portage db. (Bug #211716) diff --git a/trunk/src/revdep-rebuild/revdep-rebuild b/trunk/src/revdep-rebuild/revdep-rebuild index 8c65e26..282dee5 100755 --- a/trunk/src/revdep-rebuild/revdep-rebuild +++ b/trunk/src/revdep-rebuild/revdep-rebuild @@ -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 -- 2.26.2