From 05aef484d537e94d9fe90fbb677cd4ac5be443de Mon Sep 17 00:00:00 2001 From: scarabeus Date: Tue, 2 Nov 2010 14:05:00 +0000 Subject: [PATCH] Fix arg parsing everywhere for eshowkw. svn path=/trunk/gentoolkit/; revision=843 --- bin/eshowkw | 3 +-- pym/gentoolkit/equery/keywords.py | 5 ++--- pym/gentoolkit/eshowkw/__init__.py | 4 ++-- pym/gentoolkit/eshowkw/keywords_content.py | 6 +++++- 4 files changed, 10 insertions(+), 8 deletions(-) diff --git a/bin/eshowkw b/bin/eshowkw index df287a5..a64aa96 100644 --- a/bin/eshowkw +++ b/bin/eshowkw @@ -3,7 +3,6 @@ # Copyright 2010 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -import sys from gentoolkit.eshowkw import main as emain -emain(sys.argv) +emain(args[1:]) diff --git a/pym/gentoolkit/equery/keywords.py b/pym/gentoolkit/equery/keywords.py index d91a053..cab49a7 100644 --- a/pym/gentoolkit/equery/keywords.py +++ b/pym/gentoolkit/equery/keywords.py @@ -5,6 +5,5 @@ import sys from gentoolkit.eshowkw import main as emain -# we have equery as first argument instead of the scriptname -# so we will just ommit it -emain(sys.argv) +def main(input_args): + args.extend(input_args) \ No newline at end of file diff --git a/pym/gentoolkit/eshowkw/__init__.py b/pym/gentoolkit/eshowkw/__init__.py index 39da052..0ea4973 100644 --- a/pym/gentoolkit/eshowkw/__init__.py +++ b/pym/gentoolkit/eshowkw/__init__.py @@ -75,7 +75,7 @@ def process_args(argv): parser.add_argument('-S', '--ignore-slot', action='store_true', default=False, help='Treat slots as irelevant during detection of redundant pacakges.') - return parser.parse_args(args=argv[1:]) + return parser.parse_args(args=argv) def main(argv): global ignore_slots, bold, order, topper @@ -129,4 +129,4 @@ def main(argv): return 0 if __name__ == '__main__': - sys.exit(main(sys.argv)) + sys.exit(main(sys.argv[1:])) diff --git a/pym/gentoolkit/eshowkw/keywords_content.py b/pym/gentoolkit/eshowkw/keywords_content.py index 7f82026..235d8a7 100644 --- a/pym/gentoolkit/eshowkw/keywords_content.py +++ b/pym/gentoolkit/eshowkw/keywords_content.py @@ -155,7 +155,11 @@ class keywords_content: def __checkExist(self, pdb, package): """Check if specified package even exists.""" try: - matches = pdb.xmatch('match-all', package) + cp = port.dep_expand(package, mydb=pdb, settings=pdb.settings).cp + matches = [] + for repo in pdb.porttrees: + for cpv in pdb.cp_list(mycp=cp,mytree=[repo]): + matches.append((cpv, repo)) except port.exception.AmbiguousPackageName as Arg: msg_err = 'Ambiguous package name "%s".\n' % package found = 'Possibilities: %s' % Arg -- 2.26.2