diff options
author | Zac Medico <zmedico@gentoo.org> | 2006-05-19 00:39:05 +0000 |
---|---|---|
committer | Zac Medico <zmedico@gentoo.org> | 2006-05-19 00:39:05 +0000 |
commit | 95fc40e39c8535f84e9fc533331fa0464c763af4 (patch) | |
tree | ebd42ff9d03876100ea18e9fb79ef0c8b53a80f3 | |
parent | 7761e1d6c412822e4f8bc2fdbf4f293b66fe7923 (diff) | |
download | portage-95fc40e39c8535f84e9fc533331fa0464c763af4.tar.gz portage-95fc40e39c8535f84e9fc533331fa0464c763af4.tar.bz2 portage-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
-rwxr-xr-x | bin/portageq | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/bin/portageq b/bin/portageq index bbf001901..7e75ca2a3 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 |