From: Michael Tremer Date: Fri, 23 Apr 2021 11:02:06 +0000 (+0000) Subject: request: Match groups X-Git-Tag: 0.9.28~1285^2~258 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4ef8d4a5bc8544f0fdbdcc7350c5eac368b1506e;p=pakfire.git request: Match groups 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 --- diff --git a/src/libpakfire/request.c b/src/libpakfire/request.c index 24cd41ced..5a75e8057 100644 --- a/src/libpakfire/request.c +++ b/src/libpakfire/request.c @@ -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) {