xbps_find_pkg_repo_deps: if finding a dep failed for whatever reason,

stop immediately and return the appropiate error.

--HG--
extra : convert_revision : xtraeme%40gmail.com-20091122205257-m1wta4fk85k1hv1w
This commit is contained in:
Juan RP 2009-11-22 21:52:57 +01:00
parent 4e89a28dda
commit 3fcba399af

View File

@ -159,10 +159,12 @@ xbps_find_deps_in_pkg(prop_dictionary_t master, prop_dictionary_t pkg)
* if any of them is not there it will be added * if any of them is not there it will be added
* into the missing_deps array. * into the missing_deps array.
*/ */
rv = find_repo_deps(master, rdata->rd_repod, if ((rv = find_repo_deps(master, rdata->rd_repod,
rdata->rd_uri, pkg_rdeps); rdata->rd_uri, pkg_rdeps)) != 0) {
if (rv != 0) DPRINTF(("Error '%s' while checking rundeps!\n",
break; strerror(rv)));
return rv;
}
} }
/* /*
@ -178,10 +180,12 @@ xbps_find_deps_in_pkg(prop_dictionary_t master, prop_dictionary_t pkg)
*/ */
DPRINTF(("Checking for missing deps in %s.\n", pkgname)); DPRINTF(("Checking for missing deps in %s.\n", pkgname));
SIMPLEQ_FOREACH(rdata, &repodata_queue, chain) { SIMPLEQ_FOREACH(rdata, &repodata_queue, chain) {
rv = find_repo_deps(master, rdata->rd_repod, if ((rv = find_repo_deps(master, rdata->rd_repod,
rdata->rd_uri, missing_rdeps); rdata->rd_uri, missing_rdeps)) != 0) {
if (rv != 0) DPRINTF(("Error '%s' while checking for"
break; "missing rundeps!\n", strerror(rv)));
return rv;
}
} }
return rv; return rv;
@ -193,7 +197,7 @@ find_repo_deps(prop_dictionary_t master, prop_dictionary_t repo,
{ {
prop_dictionary_t curpkgd, tmpd = NULL; prop_dictionary_t curpkgd, tmpd = NULL;
prop_array_t curpkg_rdeps; prop_array_t curpkg_rdeps;
prop_object_t obj; prop_object_t obj = NULL;
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;
@ -207,7 +211,7 @@ find_repo_deps(prop_dictionary_t master, prop_dictionary_t repo,
* Iterate over the list of required run dependencies for * Iterate over the list of required run dependencies for
* current package. * current package.
*/ */
while ((obj = prop_object_iterator_next(iter))) { while ((obj = prop_object_iterator_next(iter)) != NULL) {
reqpkg = prop_string_cstring_nocopy(obj); reqpkg = prop_string_cstring_nocopy(obj);
/* /*
* Check if required dep is satisfied and installed. * Check if required dep is satisfied and installed.
@ -241,11 +245,11 @@ find_repo_deps(prop_dictionary_t master, prop_dictionary_t repo,
*/ */
curpkgd = xbps_find_pkg_in_dict(master, "unsorted_deps", pkgname); curpkgd = xbps_find_pkg_in_dict(master, "unsorted_deps", pkgname);
if (curpkgd) { if (curpkgd) {
prop_dictionary_get_cstring_nocopy(curpkgd, if (!prop_dictionary_get_cstring_nocopy(curpkgd,
"pkgver", &pkg_queued); "pkgver", &pkg_queued)) {
if (pkg_queued == NULL) {
free(pkgname); free(pkgname);
return errno; rv = errno;
break;
} }
if (xbps_pkgdep_match(pkg_queued, __UNCONST(reqpkg))) { if (xbps_pkgdep_match(pkg_queued, __UNCONST(reqpkg))) {
DPRINTF(("Dependency %s already queued.\n", DPRINTF(("Dependency %s already queued.\n",
@ -326,8 +330,9 @@ find_repo_deps(prop_dictionary_t master, prop_dictionary_t repo,
* Iterate on required pkg to find more deps. * Iterate on required pkg to find more deps.
*/ */
DPRINTF(("Looking for rundeps on %s.\n", reqpkg)); DPRINTF(("Looking for rundeps on %s.\n", reqpkg));
if (!find_repo_deps(master, repo, repoloc, curpkg_rdeps)) if ((rv = find_repo_deps(master, repo, repoloc,
continue; curpkg_rdeps)) != 0)
break;
} }
prop_object_iterator_release(iter); prop_object_iterator_release(iter);