]> git.ipfire.org Git - people/ms/pakfire.git/commitdiff
request: Match groups
authorMichael Tremer <michael.tremer@ipfire.org>
Fri, 23 Apr 2021 11:02:06 +0000 (11:02 +0000)
committerMichael Tremer <michael.tremer@ipfire.org>
Fri, 23 Apr 2021 11:02:06 +0000 (11:02 +0000)
This should in theory work, but it doesn't. The reason might be, that we
currently do not store groups in form of an ID array, which we could
change.

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
src/libpakfire/request.c

index 24cd41cedf2df90f7621ef0da709d0bd144bcde9..5a75e805780bc61da3dc25b2e4276933fe28886e 100644 (file)
@@ -231,6 +231,7 @@ PAKFIRE_EXPORT PakfireTransaction pakfire_request_get_transaction(struct pakfire
 
 static int pakfire_request_add_job(struct pakfire_request* request, int action, const char* what) {
        Pool* pool = pakfire_get_solv_pool(request->pakfire);
+       Id key = 0;
 
        // Add all file provides
        pool_addfileprovides(pool);
@@ -259,8 +260,18 @@ static int pakfire_request_add_job(struct pakfire_request* request, int action,
        if (*what == '/')
                flags |= SELECTION_FILELIST;
 
+       // Is this a group?
+       else if (*what == '@') {
+               flags = SELECTION_MATCH_DEPSTR;
+               key = SOLVABLE_GROUP;
+               what++;
+       }
+
        // Select all packages
-       selection_make(pool, &jobs, what, flags);
+       if (key)
+               selection_make_matchdeps(pool, &jobs, what, flags, key, 0);
+       else
+               selection_make(pool, &jobs, what, flags);
 
        // Did we find anything?
        if (jobs.count == 0) {