From: Michael Tremer Date: Thu, 2 Nov 2017 18:26:12 +0000 (+0100) Subject: Make search working X-Git-Tag: 0.9.28~1285^2~1318 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2b2d5b1b27785d630432eb1dee34deeb4b8630dd;p=pakfire.git Make search working Signed-off-by: Michael Tremer --- diff --git a/src/pakfire/base.py b/src/pakfire/base.py index e4e4259f3..277485d66 100644 --- a/src/pakfire/base.py +++ b/src/pakfire/base.py @@ -231,21 +231,7 @@ class PakfireContext(object): return sorted(pkgs) def search(self, pattern): - # Do the search. - pkgs = {} - for solv in self.pakfire.pool.search(pattern, satsolver.SEARCH_STRING|satsolver.SEARCH_FILES): - pkg = packages.SolvPackage(self.pakfire, solv) - - # Check, if a package with the name is already in the resultset - # and always replace older ones by more recent ones. - if pkg.name in pkgs: - if pkgs[pkg.name] < pkg: - pkgs[pkg.name] = pkg - else: - pkgs[pkg.name] = pkg - - # Return a list of the packages, alphabetically sorted. - return sorted(pkgs.values()) + return self.pakfire.pool.search(pattern) # Transactions diff --git a/src/pakfire/cli.py b/src/pakfire/cli.py index 105ba1e88..ebc395844 100644 --- a/src/pakfire/cli.py +++ b/src/pakfire/cli.py @@ -286,8 +286,11 @@ class Cli(object): def handle_search(self, ns): with self.pakfire(ns) as p: for pkg in p.search(ns.pattern): - s = pkg.dump(short=True) - print(s) + # Skip any -debuginfo packages + if pkg.name.endswith("-debuginfo"): + continue + + print("%-24s: %s" % (pkg.name, pkg.summary)) def handle_update(self, ns, check=False): with self.pakfire(ns) as p: