From 12b55958d8884bd6828e0888ab9dc10d38bcd72f Mon Sep 17 00:00:00 2001 From: Nagy Gabor Date: Mon, 31 Aug 2009 16:20:18 +0200 Subject: Add a new reason field to pmconflict_t struct Sometimes "foo conflicts with bar" information is not enough, see this thread: http://bbs.archlinux.org/viewtopic.php?id=77647. That's why I added a new reason field to our pmconflict_t struct that stores the packager- defined conflict that induced the fact that package1 conflicts with package2. I modified the front-end (in callback.c, sync.c, upgrade.c) to print this new information as well. Signed-off-by: Nagy Gabor --- src/pacman/sync.c | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) (limited to 'src/pacman/sync.c') diff --git a/src/pacman/sync.c b/src/pacman/sync.c index 58f60476..a1d407c0 100644 --- a/src/pacman/sync.c +++ b/src/pacman/sync.c @@ -663,10 +663,17 @@ static int sync_trans(alpm_list_t *targets) } break; case PM_ERR_CONFLICTING_DEPS: - for(i = data; i; i = alpm_list_next(i)) { + for(i = data; i; i = alpm_list_next(i)) { pmconflict_t *conflict = alpm_list_getdata(i); - printf(_(":: %s: conflicts with %s\n"), - alpm_conflict_get_package1(conflict), alpm_conflict_get_package2(conflict)); + const char *package1 = alpm_conflict_get_package1(conflict); + const char *package2 = alpm_conflict_get_package2(conflict); + const char *reason = alpm_conflict_get_reason(conflict); + /* only print reason if it contains new information */ + if(!strcmp(package1, reason) || !strcmp(package2, reason)) { + printf(_(":: %s and %s are in conflict\n"), package1, package2); + } else { + printf(_(":: %s and %s are in conflict (%s)\n"), package1, package2, reason); + } } break; default: -- cgit v1.2.3