Radish alpha
H
rad:z3QDZAW2FAfuLvihrhiyDC9fAD8G9
HardenedBSD Package Manager
Radicle
Git
Add hack to add remote candidates from different repos even if their digests are the same.
Vsevolod Stakhov committed 10 years ago
commit b6b242a7165651d86885b906b2a31af62335c5ab
parent f9a92e4
1 file changed +18 -3
modified libpkg/pkg_jobs_universe.c
@@ -187,10 +187,25 @@ pkg_jobs_universe_add_pkg(struct pkg_jobs_universe *universe, struct pkg *pkg,

	HASH_FIND_STR(universe->seen, pkg->digest, seen);
	if (seen != NULL && !force) {
-
		if (found != NULL)
-
			*found = seen->un;
+
		/*
+
		 * For remote packages we could have the same digest but different repos
+
		 * therefore we should also compare reponames
+
		 */
+
		bool other_candidate = false;

-
		return (EPKG_END);
+
		if (seen->un->pkg->type != PKG_INSTALLED && pkg->type != PKG_INSTALLED) {
+
			if (pkg->reponame && seen->un->pkg->reponame) {
+
				other_candidate =
+
						(strcmp(pkg->reponame, seen->un->pkg->reponame) != 0);
+
			}
+
		}
+

+
		if (!other_candidate) {
+
			if (found != NULL)
+
				*found = seen->un;
+

+
			return (EPKG_END);
+
		}
	}

	pkg_debug(2, "universe: add new %s pkg: %s, (%s-%s:%s)",