Implement support to update required_by objs when removing a pkg.

--HG--
extra : convert_revision : 405986d806ff23ce6348b22a2d7c48e0820ab1b9
This commit is contained in:
Juan RP 2009-02-27 16:03:25 +01:00
parent a711ace8f7
commit d9cc1d6b8f
8 changed files with 169 additions and 96 deletions

View file

@ -83,10 +83,10 @@ xbps_install_binary_pkg(const char *pkgname, const char *destdir, int flags)
assert(pkgname != NULL);
if (destdir) {
if ((rv = chdir(destdir)) != 0)
if (chdir(destdir) == -1)
return errno;
} else {
if ((rv = chdir("/")) != 0)
if (chdir("/") == -1)
return errno;
destdir = "NOTSET";
}
@ -138,6 +138,10 @@ install_binpkg_repo_cb(prop_object_t obj, void *arg, bool *cbloop_done)
return 0;
}
/*
* Check SHA256 hash for binary package before anything else.
*/
/*
* Check if this package needs dependencies.
*/
@ -167,7 +171,6 @@ install_binpkg_repo_cb(prop_object_t obj, void *arg, bool *cbloop_done)
if ((rv = xbps_install_pkg_deps(pkgname, destdir, cb->flags)) == 0) {
rv = xbps_install_binary_pkg_fini(repod, pkgrd, destdir,
cb->flags);
prop_object_release(repod);
if (rv == 0)
*cbloop_done = true;
}
@ -176,6 +179,8 @@ install_binpkg_repo_cb(prop_object_t obj, void *arg, bool *cbloop_done)
if (rv == 0)
errno = 0;
prop_object_release(repod);
return rv;
}
@ -263,7 +268,7 @@ xbps_register_pkg(prop_dictionary_t pkgrd, const char *pkgname,
automatic);
if (pkgrd && xbps_pkg_has_rundeps(pkgrd)) {
rv = xbps_update_pkg_requiredby(array, pkgrd);
rv = xbps_requiredby_pkg_add(array, pkgrd);
if (rv != 0) {
prop_object_release(pkgd);
goto out;