From 20affa5f32162ddcff57fa14d806aca996b66b0f Mon Sep 17 00:00:00 2001 From: Dave Reisner Date: Sun, 17 Jul 2011 23:33:28 -0400 Subject: fix verbose error on each repo when package isn't found --- expac.c | 21 ++++++++------------- 1 file 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); + } } } -- cgit v1.2.3-54-g00ecf