xbps-query(8): fix regression introduced in 734a2c3.

This commit is contained in:
Juan RP 2013-06-11 16:41:36 +02:00
parent b646554aea
commit 5f02790ac7

View File

@ -135,6 +135,7 @@ repo_revdeps_cb(struct xbps_repo *repo, void *arg, bool *done)
prop_object_iterator_t iter; prop_object_iterator_t iter;
prop_object_t obj; prop_object_t obj;
const char *pkgver, *arch, *pattern = arg; const char *pkgver, *arch, *pattern = arg;
int rv = 0;
(void)done; (void)done;
@ -153,12 +154,12 @@ repo_revdeps_cb(struct xbps_repo *repo, void *arg, bool *done)
prop_dictionary_get_cstring_nocopy(pkgd, prop_dictionary_get_cstring_nocopy(pkgd,
"pkgver", &pkgver); "pkgver", &pkgver);
printf("%s\n", pkgver); printf("%s\n", pkgver);
rv = EEXIST;
} }
} }
} }
prop_object_iterator_release(iter); prop_object_iterator_release(iter);
return rv;
return 0;
} }
int int
@ -169,6 +170,7 @@ repo_show_pkg_revdeps(struct xbps_handle *xhp, const char *pkg)
const char *pkgver, *vpkg; const char *pkgver, *vpkg;
unsigned int i; unsigned int i;
int rv = 0; int rv = 0;
bool matched = false;
if (xbps_pkg_version(pkg)) if (xbps_pkg_version(pkg))
pkgver = pkg; pkgver = pkg;
@ -201,8 +203,13 @@ repo_show_pkg_revdeps(struct xbps_handle *xhp, const char *pkg)
free(vpkgn); free(vpkgn);
rv = xbps_rpool_foreach(xhp, repo_revdeps_cb, rv = xbps_rpool_foreach(xhp, repo_revdeps_cb,
__UNCONST(vpkg)); __UNCONST(vpkg));
if (rv == EEXIST) {
rv = 0;
matched = true;
}
} }
} else { }
if (!matched) {
prop_dictionary_get_cstring_nocopy(pkgd, prop_dictionary_get_cstring_nocopy(pkgd,
"pkgver", &pkgver); "pkgver", &pkgver);
rv = xbps_rpool_foreach(xhp, repo_revdeps_cb, rv = xbps_rpool_foreach(xhp, repo_revdeps_cb,