Radish alpha
H
rad:z3QDZAW2FAfuLvihrhiyDC9fAD8G9
HardenedBSD Package Manager
Radicle
Git
solver: always process rdeps for remote packages
Baptiste Daroussin committed 2 months ago
commit 5bbaecb7fba1e51809c8414f29e17ca35512a273
parent 5d02e4b
1 file changed +10 -5
modified libpkg/pkg_jobs_universe.c
@@ -659,12 +659,17 @@ pkg_jobs_universe_process_item(struct pkg_jobs_universe *universe, struct pkg *p
		if (rc != EPKG_OK)
			return (rc);
		/*
-
		 * Handle reverse depends, but only when we are not already
-
		 * inside rdeps processing.  Without this guard the universe
-
		 * expands exponentially: target → dep → rdep → dep → rdep …
-
		 * pulling in thousands of unrelated packages.
+
		 * Handle reverse depends.  Limit recursive expansion to
+
		 * prevent the universe from growing exponentially
+
		 * (target → dep → rdep → dep → rdep …).
+
		 *
+
		 * Process rdeps when:
+
		 * - We are not inside rdeps processing yet (depth == 0), OR
+
		 * - This is a remote package (an upgrade is being considered
+
		 *   and its rdeps may need updating too).
		 */
-
		if (universe->rdeps_depth == 0) {
+
		if (universe->rdeps_depth == 0 ||
+
		    pkg->type != PKG_INSTALLED) {
			universe->rdeps_depth++;
			rc = pkg_jobs_universe_process_deps(universe, pkg,
				flags|DEPS_FLAG_REVERSE);