summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDave Reisner <d@falconindy.com>2011-03-16 10:36:09 -0400
committerDave Reisner <d@falconindy.com>2011-03-16 10:36:09 -0400
commitd1a229a4d17f29a5ebda65c0627bf1493d6ea3ba (patch)
tree48811f33c67e13bf562a09373c74311f3070d8b6
parent42f607046e0a515a5cb5de1305a82fc5580f3c2d (diff)
downloadexpac-d1a229a4d17f29a5ebda65c0627bf1493d6ea3ba.tar.xz
mimic pacman behavior of dumping the entire DB with no targets
-rw-r--r--expac.c18
1 files changed, 8 insertions, 10 deletions
diff --git a/expac.c b/expac.c
index e66f456..d2558a1 100644
--- a/expac.c
+++ b/expac.c
@@ -484,16 +484,14 @@ alpm_list_t *resolve_pkg(alpm_list_t *targets) {
char *pkgname, *reponame;
alpm_list_t *t, *r, *ret = NULL;
- if (search) {
- if (targets) {
- for (r = dblist; r; r = alpm_list_next(r)) {
- ret = alpm_list_join(ret, alpm_db_search(alpm_list_getdata(r), targets));
- }
- } else { /* dump full DBs */
- for (r = dblist; r; r = alpm_list_next(r)) {
- /* joining causes corruption on alpm_release(), so we copy */
- ret = alpm_list_join(ret, alpm_list_copy(alpm_db_get_pkgcache(alpm_list_getdata(r))));
- }
+ if (!targets) {
+ for (r = dblist; r; r = alpm_list_next(r)) {
+ /* joining causes corruption on alpm_release(), so we copy */
+ ret = alpm_list_join(ret, alpm_list_copy(alpm_db_get_pkgcache(alpm_list_getdata(r))));
+ }
+ } else if (search) {
+ for (r = dblist; r; r = alpm_list_next(r)) {
+ ret = alpm_list_join(ret, alpm_db_search(alpm_list_getdata(r), targets));
}
} else {
for (t = targets; t; t = alpm_list_next(t)) {