Radish alpha
H
rad:z3QDZAW2FAfuLvihrhiyDC9fAD8G9
HardenedBSD Package Manager
Radicle
Git
Be more precise about when happened to dependencies when possible
Baptiste Daroussin committed 11 years ago
commit 16f84a987f642a1c66ef8b5f817a6ad23f5480d2
parent 3bd8d81
1 file changed +9 -2
modified libpkg/pkg_jobs.c
@@ -1101,8 +1101,15 @@ pkg_jobs_need_upgrade(struct pkg *rp, struct pkg *lp)
		ret2 = pkg_deps(lp, &ld);
		if (ret1 != ret2) {
			free(rp->reason);
-
			asprintf(&rp->reason, "direct dependency changed: %s", 
-
			    rd->name);
+
			if (rd == NULL)
+
				asprintf(&rp->reason, "Direct dependency removed: %s",
+
				    ld->name);
+
			else if (ld == NULL)
+
				asprintf(&rp->reason, "Direct dependency added: %s",
+
				    rd->name);
+
			else
+
				asprintf(&rp->reason, "Direct dependency changed: %s",
+
				    rd->name);
			assert (rp->reason != NULL);
			return (true);
		}