Simplify install_binpkg_repo_cb().
--HG-- extra : convert_revision : cffcd0098292f26170589d5a5db2261a204dc2be
This commit is contained in:
parent
c5180507d3
commit
96cda65443
@ -146,20 +146,15 @@ install_binpkg_repo_cb(prop_object_t obj, void *arg, bool *cbloop_done)
|
|||||||
return EINVAL;
|
return EINVAL;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((rv = xbps_check_pkg_file_hash(pkgrd, repoloc)) != 0) {
|
if ((rv = xbps_check_pkg_file_hash(pkgrd, repoloc)) != 0)
|
||||||
prop_object_release(repod);
|
goto out;
|
||||||
return rv;
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Check if this package needs dependencies.
|
* Check if this package needs dependencies.
|
||||||
*/
|
*/
|
||||||
if (!xbps_pkg_has_rundeps(pkgrd)) {
|
if (!xbps_pkg_has_rundeps(pkgrd)) {
|
||||||
/* pkg has no deps, just install it. */
|
/* pkg has no deps, just install it. */
|
||||||
rv = xbps_install_binary_pkg_fini(repod, pkgrd,
|
goto install;
|
||||||
cb->destdir, cb->flags);
|
|
||||||
prop_object_release(repod);
|
|
||||||
return rv;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -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.
|
* Install all required dependencies and the package itself.
|
||||||
*/
|
*/
|
||||||
rv = xbps_install_pkg_deps(cb->pkgname, cb->destdir, cb->flags);
|
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) {
|
if (rv == 0) {
|
||||||
rv = xbps_install_binary_pkg_fini(repod, pkgrd,
|
*cbloop_done = true;
|
||||||
cb->destdir, cb->flags);
|
/* Cleanup errno, just in case */
|
||||||
if (rv == 0)
|
|
||||||
*cbloop_done = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Cleanup errno, just in case */
|
|
||||||
if (rv == 0)
|
|
||||||
errno = 0;
|
errno = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
out:
|
||||||
prop_object_release(repod);
|
prop_object_release(repod);
|
||||||
|
|
||||||
return rv;
|
return rv;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user