Permalink
Browse files

Display available package versions when installation fails.

This is useful when a particular version of a package was requested
and not found. In addition to a "package cannot be resolved" message,
which can be interpreted as "you misspelled package name", also
display available versions of requested package if any exist.
  • Loading branch information...
1 parent d1c81ac commit 6781dac20bf74590dacde45752820ee1c121de5b @p p committed Aug 6, 2011
Showing with 12 additions and 3 deletions.
  1. +12 −3 rpg-prepare.sh
View
@@ -194,9 +194,18 @@ heed "$freshpacks of $totalpacks packages already installed and up to date"
# Check for unsolved packages in our solved list. Unsolved packages have
# a dash "-" in their version field.
if badpacks=$(grep ' -$' "$delta")
-then heed "$(echo "$badpacks" |grep -c .) packages failed to resolve:
-$(echo "$badpacks" | cut -d ' ' -f 1)"
- exit 1
+then
+ heed "$(echo "$badpacks" |grep -c .) packages failed to resolve:"
+ for pack in $(echo "$badpacks" | cut -d ' ' -f 1)
+ do
+ heed "$pack ($(cut -d ' ' -f 3- "$packlist"))"
+ done
+ versions=$(grep "^$pack " "$release" | cut -d ' ' -f 2)
+ if test -n "$versions"
+ then
+ heed "available versions: $(echo $versions)"
+ fi
+ exit 1
fi
# Note the number of packages that are now queued up for installation.

0 comments on commit 6781dac

Please sign in to comment.