summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2006-05-19 00:39:05 +0000
committerZac Medico <zmedico@gentoo.org>2006-05-19 00:39:05 +0000
commit95fc40e39c8535f84e9fc533331fa0464c763af4 (patch)
treeebd42ff9d03876100ea18e9fb79ef0c8b53a80f3 /bin/portageq
parentFix prepstrip split-debug paths for bug #133628. Thanks to kevquinn for this... (diff)
downloadportage-multirepo-95fc40e39c8535f84e9fc533331fa0464c763af4.tar.gz
portage-multirepo-95fc40e39c8535f84e9fc533331fa0464c763af4.tar.bz2
portage-multirepo-95fc40e39c8535f84e9fc533331fa0464c763af4.zip
Catch a ValueError thrown from cpv_expand and use it print an error message (to stderr) which includes a list of packages for bug #133731. No changes to quickpkg are necessary because it doesn't get anything from portageq on stdout in this case and it simply assumes there is no match.
svn path=/main/trunk/; revision=3376
Diffstat (limited to 'bin/portageq')
-rwxr-xr-xbin/portageq9
1 files changed, 8 insertions, 1 deletions
diff --git a/bin/portageq b/bin/portageq
index bbf00190..7e75ca2a 100755
--- a/bin/portageq
+++ b/bin/portageq
@@ -136,7 +136,14 @@ def match(argv):
sys.exit(2)
try:
print string.join(portage.db[argv[0]]["vartree"].dbapi.match(argv[1]),"\n")
- except KeyError:
+ except ValueError, e:
+ # Multiple matches thrown from cpv_expand
+ pkgs = e.args[0]
+ # An error has occurred so we writemsg to stderr and exit nonzero.
+ portage.writemsg("The following packages available:\n", noiselevel=-1)
+ for pkg in pkgs:
+ portage.writemsg("* %s\n" % pkg, noiselevel=-1)
+ portage.writemsg("\nPlease use a more specific atom.\n", noiselevel=-1)
sys.exit(1)
match.uses_root = True