diff options
author | Dave Reisner <dreisner@archlinux.org> | 2011-07-17 23:33:28 -0400 |
---|---|---|
committer | Dave Reisner <dreisner@archlinux.org> | 2011-07-17 23:33:28 -0400 |
commit | 20affa5f32162ddcff57fa14d806aca996b66b0f (patch) | |
tree | 753f47b4271b252d47df4fe3d92761e1cbf16107 /expac.c | |
parent | 928f60ecca4d577b35ac11efa9e9566c779a41b4 (diff) | |
download | expac-20affa5f32162ddcff57fa14d806aca996b66b0f.tar.xz |
fix verbose error on each repo when package isn't found
Diffstat (limited to 'expac.c')
-rw-r--r-- | expac.c | 21 |
1 files changed, 8 insertions, 13 deletions
@@ -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); + } } } |