summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--expac.c21
1 files changed, 8 insertions, 13 deletions
diff --git a/expac.c b/expac.c
index ee057aa..57f1937 100644
--- a/expac.c
+++ b/expac.c
@@ -516,6 +516,8 @@ static alpm_list_t *resolve_pkg(alpm_list_t *targets) {
}
} else {
for (t = targets; t; t = alpm_list_next(t)) {
+ pmpkg_t *pkg = NULL;
+
pkgname = reponame = alpm_list_getdata(t);
if (strchr(pkgname, '/')) {
strsep(&pkgname, "/");
@@ -524,24 +526,14 @@ static alpm_list_t *resolve_pkg(alpm_list_t *targets) {
}
for (r = dblist; r; r = alpm_list_next(r)) {
- pmdb_t *repo;
- pmpkg_t *pkg;
+ pmdb_t *repo = alpm_list_getdata(r);
- repo = alpm_list_getdata(r);
if (reponame && strcmp(reponame, alpm_db_get_name(repo)) != 0) {
continue;
}
- pkg = alpm_db_get_pkg(repo, pkgname);
- /* try to resolve as provide (e.g. awk => gawk) */
- if (!pkg) {
- pkg = alpm_find_satisfier(alpm_db_get_pkgcache(repo), pkgname);
- }
-
- if (!pkg) {
- if (verbose) {
- fprintf(stderr, "error: package `%s' not found\n", pkgname);
- }
+ if (!(pkg = alpm_db_get_pkg(repo, pkgname)) &&
+ !(pkg = alpm_find_satisfier(alpm_db_get_pkgcache(repo), pkgname))) {
continue;
}
@@ -550,6 +542,9 @@ static alpm_list_t *resolve_pkg(alpm_list_t *targets) {
break;
}
}
+ if (!pkg && verbose) {
+ fprintf(stderr, "error: package `%s' not found\n", pkgname);
+ }
}
}