Simplify install_binpkg_repo_cb().

--HG--
extra : convert_revision : cffcd0098292f26170589d5a5db2261a204dc2be
This commit is contained in:
Juan RP 2009-03-16 07:03:25 +01:00
parent c5180507d3
commit 96cda65443
1 changed files with 13 additions and 16 deletions

View File

@ -146,20 +146,15 @@ install_binpkg_repo_cb(prop_object_t obj, void *arg, bool *cbloop_done)
return EINVAL;
}
if ((rv = xbps_check_pkg_file_hash(pkgrd, repoloc)) != 0) {
prop_object_release(repod);
return rv;
}
if ((rv = xbps_check_pkg_file_hash(pkgrd, repoloc)) != 0)
goto out;
/*
* Check if this package needs dependencies.
*/
if (!xbps_pkg_has_rundeps(pkgrd)) {
/* pkg has no deps, just install it. */
rv = xbps_install_binary_pkg_fini(repod, pkgrd,
cb->destdir, cb->flags);
prop_object_release(repod);
return rv;
goto install;
}
/*
@ -178,17 +173,19 @@ install_binpkg_repo_cb(prop_object_t obj, void *arg, bool *cbloop_done)
* Install all required dependencies and the package itself.
*/
rv = xbps_install_pkg_deps(cb->pkgname, cb->destdir, cb->flags);
if (rv != 0)
goto out;
install:
rv = xbps_install_binary_pkg_fini(repod, pkgrd,
cb->destdir, cb->flags);
if (rv == 0) {
rv = xbps_install_binary_pkg_fini(repod, pkgrd,
cb->destdir, cb->flags);
if (rv == 0)
*cbloop_done = true;
}
/* Cleanup errno, just in case */
if (rv == 0)
*cbloop_done = true;
/* Cleanup errno, just in case */
errno = 0;
}
out:
prop_object_release(repod);
return rv;