xbps_find_pkg_repo_deps: don't propagate rv to next calls using it,

add some more debugging for future problems.

--HG--
extra : convert_revision : xtraeme%40gmail.com-20091122234348-g8x4r7kqgnex30w6
This commit is contained in:
Juan RP 2009-11-23 00:43:48 +01:00
parent 3fcba399af
commit 3bb3858cfb

View File

@ -195,9 +195,9 @@ static int
find_repo_deps(prop_dictionary_t master, prop_dictionary_t repo, find_repo_deps(prop_dictionary_t master, prop_dictionary_t repo,
const char *repoloc, prop_array_t array) const char *repoloc, prop_array_t array)
{ {
prop_dictionary_t curpkgd, tmpd = NULL; prop_dictionary_t curpkgd, tmpd;
prop_array_t curpkg_rdeps; prop_array_t curpkg_rdeps;
prop_object_t obj = NULL; prop_object_t obj;
prop_object_iterator_t iter; prop_object_iterator_t iter;
const char *reqpkg, *reqvers, *pkg_queued; const char *reqpkg, *reqvers, *pkg_queued;
char *pkgname; char *pkgname;
@ -219,6 +219,7 @@ find_repo_deps(prop_dictionary_t master, prop_dictionary_t repo,
rv = xbps_check_is_installed_pkg(reqpkg); rv = xbps_check_is_installed_pkg(reqpkg);
if (rv == -1) { if (rv == -1) {
/* There was an error checking it... */ /* There was an error checking it... */
DPRINTF(("Error matching reqdep %s\n", reqpkg));
break; break;
} else if (rv == 1) { } else if (rv == 1) {
/* Required pkg dependency is satisfied */ /* Required pkg dependency is satisfied */
@ -247,6 +248,7 @@ find_repo_deps(prop_dictionary_t master, prop_dictionary_t repo,
if (curpkgd) { if (curpkgd) {
if (!prop_dictionary_get_cstring_nocopy(curpkgd, if (!prop_dictionary_get_cstring_nocopy(curpkgd,
"pkgver", &pkg_queued)) { "pkgver", &pkg_queued)) {
DPRINTF(("pkgver failed %s\n", reqpkg));
free(pkgname); free(pkgname);
rv = errno; rv = errno;
break; break;
@ -268,6 +270,8 @@ find_repo_deps(prop_dictionary_t master, prop_dictionary_t repo,
if (curpkgd == NULL) { if (curpkgd == NULL) {
rv = add_missing_reqdep(master, pkgname, reqvers); rv = add_missing_reqdep(master, pkgname, reqvers);
if (rv != 0 && rv != EEXIST) { if (rv != 0 && rv != EEXIST) {
DPRINTF(("add missing reqdep failed %s\n",
reqpkg));
free(pkgname); free(pkgname);
break; break;
} else if (rv == EEXIST) { } else if (rv == EEXIST) {
@ -301,6 +305,7 @@ find_repo_deps(prop_dictionary_t master, prop_dictionary_t repo,
* Package is on repo, add it into the dictionary. * Package is on repo, add it into the dictionary.
*/ */
if ((rv = store_dependency(master, curpkgd, repoloc)) != 0) { if ((rv = store_dependency(master, curpkgd, repoloc)) != 0) {
DPRINTF(("store_dependency failed %s\n", reqpkg));
free(pkgname); free(pkgname);
break; break;
} }
@ -311,9 +316,13 @@ find_repo_deps(prop_dictionary_t master, prop_dictionary_t repo,
* can remove it now it has been found in current repository. * can remove it now it has been found in current repository.
*/ */
rv = xbps_remove_pkg_from_dict(master, "missing_deps", pkgname); rv = xbps_remove_pkg_from_dict(master, "missing_deps", pkgname);
if (rv == 0) if (rv == ENOENT) {
rv = 0;
} else if (rv == 0) {
DPRINTF(("Removed missing dep %s.\n", pkgname)); DPRINTF(("Removed missing dep %s.\n", pkgname));
else if (rv != 0 && rv != ENOENT) { } else {
DPRINTF(("Removing missing dep %s returned %s\n",
pkgname, strerror(rv)));
free(pkgname); free(pkgname);
break; break;
} }
@ -331,8 +340,11 @@ find_repo_deps(prop_dictionary_t master, prop_dictionary_t repo,
*/ */
DPRINTF(("Looking for rundeps on %s.\n", reqpkg)); DPRINTF(("Looking for rundeps on %s.\n", reqpkg));
if ((rv = find_repo_deps(master, repo, repoloc, if ((rv = find_repo_deps(master, repo, repoloc,
curpkg_rdeps)) != 0) curpkg_rdeps)) != 0) {
DPRINTF(("Error checking %s rundeps %s\n",
reqpkg, strerror(rv)));
break; break;
}
} }
prop_object_iterator_release(iter); prop_object_iterator_release(iter);