diff options
author | Dan McGee <dan@archlinux.org> | 2009-06-06 19:30:30 +0200 |
---|---|---|
committer | Dan McGee <dan@archlinux.org> | 2009-06-24 04:51:49 +0200 |
commit | 8c8fa2d82c524111879e44fd63683a612278d042 (patch) | |
tree | b3cc7ecad4a8825c65994679bb2e307eb82dc70c /lib/libalpm | |
parent | 8bbaf045b9ce7933778aa3c7e84ad4dc7c377238 (diff) | |
download | pacman-8c8fa2d82c524111879e44fd63683a612278d042.tar.gz pacman-8c8fa2d82c524111879e44fd63683a612278d042.tar.xz |
Search package groups when searching a DB
See FS#13099. This makes sense especially for the pacman frontend, as we
show groups in the search output.
Signed-off-by: Dan McGee <dan@archlinux.org>
Diffstat (limited to 'lib/libalpm')
-rw-r--r-- | lib/libalpm/db.c | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/lib/libalpm/db.c b/lib/libalpm/db.c index 6749ab1e..6865cd5a 100644 --- a/lib/libalpm/db.c +++ b/lib/libalpm/db.c @@ -398,10 +398,10 @@ alpm_list_t *_alpm_db_search(pmdb_t *db, const alpm_list_t *needles) else if (desc && regexec(®, desc, 0, 0, 0) == 0) { matched = desc; } - /* check provides */ /* TODO: should we be doing this, and should we print something * differently when we do match it since it isn't currently printed? */ - else { + if(!matched) { + /* check provides */ for(k = alpm_pkg_get_provides(pkg); k; k = k->next) { if (regexec(®, k->data, 0, 0, 0) == 0) { matched = k->data; @@ -409,6 +409,15 @@ alpm_list_t *_alpm_db_search(pmdb_t *db, const alpm_list_t *needles) } } } + if(!matched) { + /* check groups */ + for(k = alpm_pkg_get_groups(pkg); k; k = k->next) { + if (regexec(®, k->data, 0, 0, 0) == 0) { + matched = k->data; + break; + } + } + } if(matched != NULL) { _alpm_log(PM_LOG_DEBUG, " search target '%s' matched '%s'\n", |