diff options
author | Dave Reisner <d@falconindy.com> | 2011-03-16 10:36:09 -0400 |
---|---|---|
committer | Dave Reisner <d@falconindy.com> | 2011-03-16 10:36:09 -0400 |
commit | d1a229a4d17f29a5ebda65c0627bf1493d6ea3ba (patch) | |
tree | 48811f33c67e13bf562a09373c74311f3070d8b6 /expac.c | |
parent | 42f607046e0a515a5cb5de1305a82fc5580f3c2d (diff) | |
download | expac-d1a229a4d17f29a5ebda65c0627bf1493d6ea3ba.tar.xz |
mimic pacman behavior of dumping the entire DB with no targets
Diffstat (limited to 'expac.c')
-rw-r--r-- | expac.c | 18 |
1 files changed, 8 insertions, 10 deletions
@@ -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)) { |