diff options
| author | idl0r <idl0r@gentoo.org> | 2010-03-31 12:45:41 +0000 |
|---|---|---|
| committer | idl0r <idl0r@gentoo.org> | 2010-03-31 12:45:41 +0000 |
| commit | bb2b0ce4fe9890c6bd27293c0b6e47659130280f (patch) | |
| tree | f1dabeaec261ffe9d18718a2c2e433572211e4cd | |
| parent | 306f0452ee9cdd3cffacaf43b9df94395e957354 (diff) | |
| download | gentoolkit-bb2b0ce4fe9890c6bd27293c0b6e47659130280f.tar.gz | |
epkginfo: Fix epkginfo to handle ambiguous package names.
svn path=/trunk/gentoolkit/; revision=762
| -rw-r--r-- | ChangeLog | 3 | ||||
| -rwxr-xr-x | bin/epkginfo | 13 |
2 files changed, 16 insertions, 0 deletions
@@ -1,3 +1,6 @@ +2010-03-31: Christian Ruppert <idl0r@gentoo.org> + * epkginfo: Fix epkginfo to handle ambiguous package names. + 2010-03-09: Paul Varner <fuzzyray@gentoo.org> * gentoolkit: Add inital py3k support. * analyse: Add new analyse utility from dol-sen. This will probably diff --git a/bin/epkginfo b/bin/epkginfo index 30f2ab5..953b4a4 100755 --- a/bin/epkginfo +++ b/bin/epkginfo @@ -21,6 +21,7 @@ import sys from gentoolkit import equery, errors from gentoolkit.equery import mod_usage from gentoolkit.equery.meta import main, print_help +from portage.exception import AmbiguousPackageName def print_epkginfo_help(): print(mod_usage(mod_name="epkginfo")) @@ -34,6 +35,18 @@ if not args or set(('-h', '--help')).intersection(args): else: try: main(args) + except AmbiguousPackageName as e: + pkgs = e.args[0] + for candidate in pkgs: + print(candidate) + + from gentoolkit import pprinter as pp + from os.path import basename # To get the short name + + print(file=sys.stderr) + print(pp.error("The short ebuild name '%s' is ambiguous. Please specify" % basename(pkgs[0])), + file=sys.stderr, end="") + pp.die(1, "one of the above fully-qualified ebuild names instead.") except errors.GentoolkitException as err: from gentoolkit import pprinter as pp pp.die(1, str(err)) |
