Permalink
Browse files

fix verbose error on each repo when package isn't found

  • Loading branch information...
1 parent 928f60e commit 20affa5f32162ddcff57fa14d806aca996b66b0f @falconindy committed Jul 18, 2011
Showing with 8 additions and 13 deletions.
  1. +8 −13 expac.c
View
21 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);
+ }
}
}

0 comments on commit 20affa5

Please sign in to comment.