From 037652d93f677c5864541ef9992c9cfa04571c77 Mon Sep 17 00:00:00 2001
From: Nagy Gabor <ngaba@bibl.u-szeged.hu>
Date: Wed, 21 Nov 2007 01:03:08 +0100
Subject: [PATCH] Improved 'dependency cycle' warning

From now on libalpm informs user about packages which will be installed/removed in wrong order

Signed-off-by: Nagy Gabor <ngaba@bibl.u-szeged.hu>
---
 lib/libalpm/deps.c |    9 ++++++++-
 1 files changed, 8 insertions(+), 1 deletions(-)

diff --git a/lib/libalpm/deps.c b/lib/libalpm/deps.c
index 5d88c37..1c9aa1b 100644
--- a/lib/libalpm/deps.c
+++ b/lib/libalpm/deps.c
@@ -187,7 +187,14 @@ alpm_list_t *_alpm_sortbydeps(alpm_list_t *targets, pmtranstype_t mode)
 				vertex = nextchild;
 			}
 			else if(nextchild->state == -1) {
-				_alpm_log(PM_LOG_WARNING, _("dependency cycle detected\n"));
+				pmpkg_t *vertexpkg = vertex->data;
+				pmpkg_t *childpkg = nextchild->data;
+				_alpm_log(PM_LOG_WARNING, _("dependency cycle detected:\n"));
+				if(mode == PM_TRANS_TYPE_REMOVE) {
+					_alpm_log(PM_LOG_WARNING, _("%s will be removed after its %s dependency\n"), vertexpkg->name, childpkg->name);
+				} else {
+					_alpm_log(PM_LOG_WARNING, _("%s will be installed before its %s dependency\n"), vertexpkg->name, childpkg->name);
+				}
 			}
 		}
 		if(!found) {
-- 
1.5.3.6

