Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/pacman/query.c14
-rw-r--r--src/pacman/sync.c14
2 files changed, 22 insertions, 6 deletions
diff --git a/src/pacman/query.c b/src/pacman/query.c
index 251c6faa..90ff3773 100644
--- a/src/pacman/query.c
+++ b/src/pacman/query.c
@@ -175,9 +175,17 @@ static int query_search(alpm_list_t *targets)
if (!config->quiet) {
if((grp = alpm_pkg_get_groups(pkg)) != NULL) {
- /* TODO handle multiple groups */
- const char *group = alpm_list_getdata(grp);
- printf(" (%s)", group);
+ alpm_list_t *k;
+ printf(" (");
+ for(k = grp; k; k = alpm_list_next(k)) {
+ const char *group = alpm_list_getdata(k);
+ printf("%s", group);
+ if(alpm_list_next(k)) {
+ /* only print a spacer if there are more groups */
+ printf(" ");
+ }
+ }
+ printf(")");
}
/* we need a newline and initial indent first */
diff --git a/src/pacman/sync.c b/src/pacman/sync.c
index 5f2451a8..5c627393 100644
--- a/src/pacman/sync.c
+++ b/src/pacman/sync.c
@@ -351,10 +351,18 @@ static int sync_search(alpm_list_t *syncs, alpm_list_t *targets)
}
if (!config->quiet) {
- /* TODO package in multiple groups needs to be handled, do a loop */
if((grp = alpm_pkg_get_groups(pkg)) != NULL) {
- const char *group = alpm_list_getdata(grp);
- printf(" (%s)", group);
+ alpm_list_t *k;
+ printf(" (");
+ for(k = grp; k; k = alpm_list_next(k)) {
+ const char *group = alpm_list_getdata(k);
+ printf("%s", group);
+ if(alpm_list_next(k)) {
+ /* only print a spacer if there are more groups */
+ printf(" ");
+ }
+ }
+ printf(")");
}
/* we need a newline and initial indent first */