summaryrefslogtreecommitdiffstats
path: root/expac.c
diff options
context:
space:
mode:
Diffstat (limited to 'expac.c')
-rw-r--r--expac.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/expac.c b/expac.c
index ded1432..63c2562 100644
--- a/expac.c
+++ b/expac.c
@@ -495,8 +495,15 @@ alpm_list_t *resolve_pkg(alpm_list_t *targets) {
alpm_list_t *t, *r, *ret = NULL;
if (search) {
- for (r = dblist; r; r = alpm_list_next(r)) {
- ret = alpm_list_join(ret, alpm_db_search(alpm_list_getdata(r), targets));
+ 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))));
+ }
}
} else {
for (t = targets; t; t = alpm_list_next(t)) {
@@ -518,6 +525,7 @@ alpm_list_t *resolve_pkg(alpm_list_t *targets) {
pkg = alpm_db_get_pkg(repo, pkgname);
#ifdef _HAVE_ALPM_FIND_SATISFIER
+ /* try to resolve as provide (e.g. awk => gawk) */
if (!pkg) {
pkg = alpm_find_satisfier(alpm_db_get_pkgcache(repo), pkgname);
}