diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/pacman/callback.c | 18 | ||||
-rw-r--r-- | src/pacman/sync.c | 13 | ||||
-rw-r--r-- | src/pacman/upgrade.c | 11 |
3 files changed, 33 insertions, 9 deletions
diff --git a/src/pacman/callback.c b/src/pacman/callback.c index 8b611f1a..9376ab6c 100644 --- a/src/pacman/callback.c +++ b/src/pacman/callback.c @@ -259,10 +259,20 @@ void cb_trans_conv(pmtransconv_t event, void *data1, void *data2, alpm_pkg_get_name(data2)); break; case PM_TRANS_CONV_CONFLICT_PKG: - *response = yesno(_(":: %s conflicts with %s. Remove %s?"), - (char *)data1, - (char *)data2, - (char *)data2); + /* data parameters: target package, local package, conflict (strings) */ + /* print conflict only if it contains new information */ + if(!strcmp(data1, data3) || !strcmp(data2, data3)) { + *response = yesno(_(":: %s and %s are in conflict. Remove %s?"), + (char *)data1, + (char *)data2, + (char *)data2); + } else { + *response = yesno(_(":: %s and %s are in conflict (%s). Remove %s?"), + (char *)data1, + (char *)data2, + (char *)data3, + (char *)data2); + } break; case PM_TRANS_CONV_REMOVE_PKGS: { 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: diff --git a/src/pacman/upgrade.c b/src/pacman/upgrade.c index e7691185..91888fec 100644 --- a/src/pacman/upgrade.c +++ b/src/pacman/upgrade.c @@ -110,8 +110,15 @@ int pacman_upgrade(alpm_list_t *targets) case PM_ERR_CONFLICTING_DEPS: 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; case PM_ERR_FILE_CONFLICTS: |