summaryrefslogtreecommitdiffstats
path: root/src/pacman/query.c
diff options
context:
space:
mode:
authorAaron Griffin <aaron@archlinux.org>2007-01-24 09:51:50 +0100
committerAaron Griffin <aaron@archlinux.org>2007-01-24 09:51:50 +0100
commit170d63190a3cfb0c12ee9ddfe07b21f20825bd6f (patch)
treec1cad21e75daf695f61f83ca1072d0a52343a673 /src/pacman/query.c
parent1b61cc8c69025ddd394401a506b21f16df5d4e6d (diff)
downloadpacman-170d63190a3cfb0c12ee9ddfe07b21f20825bd6f.tar.gz
pacman-170d63190a3cfb0c12ee9ddfe07b21f20825bd6f.tar.xz
* Shuffled some of the alpm_list free funtions - still not perfect, but better
* Added alpm_list_remove_node for single list node removal * Proper error checking/output for failed db_read/db_write (missing files) * Invalid packages (missing files) are now removed from the package cache * -Qs and -Ss output now look the same * config.rpath causes errors on one machine I had, so I added it to CVS * Fixed a "clobbered memory" issue when installing groups - only the outer list should be free'd, not the contained data
Diffstat (limited to 'src/pacman/query.c')
-rw-r--r--src/pacman/query.c17
1 files changed, 12 insertions, 5 deletions
diff --git a/src/pacman/query.c b/src/pacman/query.c
index 4124f400..62e7ef10 100644
--- a/src/pacman/query.c
+++ b/src/pacman/query.c
@@ -98,16 +98,23 @@ int pacman_query(alpm_list_t *targets)
return(1);
}
for(i = ret; i; i = alpm_list_next(i)) {
+ char *group = NULL;
+ alpm_list_t *grp;
pmpkg_t *pkg = alpm_list_getdata(i);
- printf("local/%s/%s %s\n ",
- (char *)alpm_list_getdata(alpm_pkg_get_groups(pkg)),
- alpm_pkg_get_name(pkg),
- alpm_pkg_get_version(pkg));
+ printf("local/%s %s", alpm_pkg_get_name(pkg), alpm_pkg_get_version(pkg));
+
+ if((grp = alpm_pkg_get_groups(pkg)) != NULL) {
+ group = alpm_list_getdata(grp);
+ printf(" (%s)\n ", (char *)alpm_list_getdata(grp));
+ } else {
+ printf("\n ");
+ }
+
indentprint(alpm_pkg_get_desc(pkg), 4);
printf("\n");
}
- alpm_list_free_outer(ret);
+ alpm_list_free(ret);
return(0);
}