From cb28e7959a0aee603e78417fdc20ebd480b4394b Mon Sep 17 00:00:00 2001 From: Duncan Overbruck Date: Mon, 5 Aug 2019 11:48:11 +0200 Subject: [PATCH] Revert "lib/transaction_ops.c: remove updating all reverse dependencies" This reverts commit 5e4d33a58fb96640e03dbf0d11417a3297f6247b. --- lib/transaction_ops.c | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/lib/transaction_ops.c b/lib/transaction_ops.c index ef9bb19a..2a078c25 100644 --- a/lib/transaction_ops.c +++ b/lib/transaction_ops.c @@ -342,6 +342,7 @@ xbps_transaction_update_packages(struct xbps_handle *xhp) int xbps_transaction_update_pkg(struct xbps_handle *xhp, const char *pkg) { + xbps_array_t rdeps; int rv; rv = xbps_autoupdate(xhp); @@ -358,6 +359,20 @@ xbps_transaction_update_pkg(struct xbps_handle *xhp, const char *pkg) break; } + rdeps = xbps_pkgdb_get_pkg_revdeps(xhp, pkg); + for (unsigned int i = 0; i < xbps_array_count(rdeps); i++) { + const char *curpkgver = NULL; + char *curpkgn; + + xbps_array_get_cstring_nocopy(rdeps, i, &curpkgver); + curpkgn = xbps_pkg_name(curpkgver); + assert(curpkgn); + rv = trans_find_pkg(xhp, curpkgn, false, false); + free(curpkgn); + xbps_dbg_printf(xhp, "%s: trans_find_pkg %s: %d\n", __func__, curpkgver, rv); + if (rv && rv != ENOENT && rv != EEXIST && rv != ENODEV) + return rv; + } rv = trans_find_pkg(xhp, pkg, false, false); xbps_dbg_printf(xhp, "%s: trans_find_pkg %s: %d\n", __func__, pkg, rv); return rv; @@ -367,6 +382,7 @@ int xbps_transaction_install_pkg(struct xbps_handle *xhp, const char *pkg, bool reinstall) { + xbps_array_t rdeps; int rv; rv = xbps_autoupdate(xhp); @@ -382,6 +398,20 @@ xbps_transaction_install_pkg(struct xbps_handle *xhp, const char *pkg, break; } + rdeps = xbps_pkgdb_get_pkg_revdeps(xhp, pkg); + for (unsigned int i = 0; i < xbps_array_count(rdeps); i++) { + const char *curpkgver = NULL; + char *curpkgn; + + xbps_array_get_cstring_nocopy(rdeps, i, &curpkgver); + curpkgn = xbps_pkg_name(curpkgver); + assert(curpkgn); + rv = trans_find_pkg(xhp, curpkgn, false, false); + free(curpkgn); + xbps_dbg_printf(xhp, "%s: trans_find_pkg %s: %d\n", __func__, curpkgver, rv); + if (rv && rv != ENOENT && rv != EEXIST && rv != ENODEV) + return rv; + } rv = trans_find_pkg(xhp, pkg, reinstall, false); xbps_dbg_printf(xhp, "%s: trans_find_pkg %s: %d\n", __func__, pkg, rv); return rv;