]> git.ipfire.org Git - pakfire.git/commitdiff
pakfire: Fix searching for descriptions
authorMichael Tremer <michael.tremer@ipfire.org>
Tue, 13 Dec 2022 11:38:47 +0000 (11:38 +0000)
committerMichael Tremer <michael.tremer@ipfire.org>
Tue, 13 Dec 2022 11:38:47 +0000 (11:38 +0000)
SEARCH_SUBSTRING and SEARCH_GLOB does not seem to work together.

Therefore I am dropping SEARCH_GLOB because a substring search is the
more intuitive one.

Fixes: #12998
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
src/libpakfire/pakfire.c

index 7a86c7f2c25854fb29d1d94d979e10d63f0ef545..0f37556060853b76def159258c4a2faba3fb233d 100644 (file)
@@ -1440,7 +1440,6 @@ PAKFIRE_EXPORT int pakfire_search(struct pakfire* pakfire, const char* what, int
                struct pakfire_packagelist** list) {
        Queue matches;
        Dataiterator di;
-       int dflags = 0;
        int r;
 
        // Get the pool ready
@@ -1449,13 +1448,8 @@ PAKFIRE_EXPORT int pakfire_search(struct pakfire* pakfire, const char* what, int
        // Initialize the result queue
        queue_init(&matches);
 
-       if (flags & PAKFIRE_SEARCH_NAME_ONLY)
-               dflags = SEARCH_STRING|SEARCH_GLOB;
-       else
-               dflags = SEARCH_SUBSTRING|SEARCH_NOCASE|SEARCH_GLOB;
-
        // Setup the data interator
-       dataiterator_init(&di, pakfire->pool, 0, 0, 0, what, dflags);
+       dataiterator_init(&di, pakfire->pool, 0, 0, 0, what, SEARCH_SUBSTRING|SEARCH_NOCASE);
 
        const Id keys[] = {
                SOLVABLE_NAME,