From d1a229a4d17f29a5ebda65c0627bf1493d6ea3ba Mon Sep 17 00:00:00 2001 From: Dave Reisner Date: Wed, 16 Mar 2011 10:36:09 -0400 Subject: mimic pacman behavior of dumping the entire DB with no targets --- expac.c | 18 ++++++++---------- 1 file 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)) { -- cgit v1.2.3-54-g00ecf