Radish alpha
H
rad:z3QDZAW2FAfuLvihrhiyDC9fAD8G9
HardenedBSD Package Manager
Radicle
Git
In multi repo when printing the found conflicts specify which repo the package conflicting are from
Baptiste Daroussin committed 9 years ago
commit cae1e5c2d4e72675543559ca24d18f16836fe3f2
parent 5840539
2 files changed +19 -7
modified src/event.c
@@ -572,7 +572,7 @@ event_callback(void *data, struct pkg_event *ev)
	struct cleanup *evtmp;
	int *debug = data, i;
	struct pkg_event_conflict *cur_conflict;
-
	const char *filename;
+
	const char *filename, *reponame;

	if (msg_buf == NULL) {
		msg_buf = sbuf_new_auto();
@@ -909,10 +909,21 @@ event_callback(void *data, struct pkg_event *ev)
		if (conflicts == NULL) {
			conflicts = sbuf_new_auto();
		}
-
		pkg_sbuf_printf(conflicts,
-
		    "  - %n-%v conflicts with %n-%v on %S\n",
-
		    ev->e_conflicts.p1, ev->e_conflicts.p1,
-
		    ev->e_conflicts.p2, ev->e_conflicts.p2,
+
		pkg_sbuf_printf(conflicts, "  - %n-%v",
+
		    ev->e_conflicts.p1, ev->e_conflicts.p1);
+
		if (pkg_repos_total_count() > 1) {
+
			pkg_get(ev->e_conflicts.p1, PKG_REPONAME, &reponame);
+
			sbuf_printf(conflicts, " [%s]",
+
			    reponame == NULL ? "installed" : reponame);
+
		}
+
		pkg_sbuf_printf(conflicts, " conflicts with %n-%v",
+
		    ev->e_conflicts.p2, ev->e_conflicts.p2);
+
		if (pkg_repos_total_count() > 1) {
+
			pkg_get(ev->e_conflicts.p2, PKG_REPONAME, &reponame);
+
			sbuf_printf(conflicts, " [%s]",
+
			    reponame == NULL ? "installed" : reponame);
+
		}
+
		sbuf_printf(conflicts, " on %s\n",
		    ev->e_conflicts.path);
		break;
	default:
modified tests/frontend/conflicts-multirepo.sh
@@ -157,8 +157,9 @@ local2 repository update completed. 2 packages processed.
Updating database digests format:  done
Checking for upgrades (2 candidates):  done
Processing candidates (2 candidates):  done
-
Checking integrity... done (1 conflicting)
-
  - test-1.1 conflicts with test2-1 on ${TMPDIR}/b
+
Checking integrity... done (2 conflicting)
+
  - test-1.1 [local2] conflicts with test2-1 [local1] on ${TMPDIR}/b
+
  - test-1.1 [local2] conflicts with test2-1 [installed] on ${TMPDIR}/b
Checking integrity... done (0 conflicting)
The following 2 package(s) will be affected (of 0 checked):