]> git.ipfire.org Git - pakfire.git/commitdiff
Make search working
authorMichael Tremer <michael.tremer@ipfire.org>
Thu, 2 Nov 2017 18:26:12 +0000 (19:26 +0100)
committerMichael Tremer <michael.tremer@ipfire.org>
Thu, 2 Nov 2017 18:26:12 +0000 (19:26 +0100)
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
src/pakfire/base.py
src/pakfire/cli.py

index e4e4259f33af9af4505560a92e1f9604c291f58b..277485d66741c08593a848b5b019f38d4f79f522 100644 (file)
@@ -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
 
index 105ba1e88a4e611d7a0f05794a655cb14d87df5d..ebc39584468ffbb45d535d5c4a6989d053625c03 100644 (file)
@@ -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: