summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAurelien Foret <aurelien@archlinux.org>2006-02-05 09:34:49 +0000
committerAurelien Foret <aurelien@archlinux.org>2006-02-05 09:34:49 +0000
commitbcd7ce0dfdc773be440cae5f87b6b9538442aef3 (patch)
tree79cacbb27374bedbb1897076aa1d1c47de88380b
parent325e3b6b98ee4ca217b153157936b77dc570bb57 (diff)
downloadpacman-bcd7ce0dfdc773be440cae5f87b6b9538442aef3.tar.xz
added support for the PM_CONFLICT structure to handle file conflicts
-rw-r--r--src/pacman/add.c17
-rw-r--r--src/pacman/sync.c15
2 files changed, 28 insertions, 4 deletions
diff --git a/src/pacman/add.c b/src/pacman/add.c
index 9020449d..c63e14b5 100644
--- a/src/pacman/add.c
+++ b/src/pacman/add.c
@@ -91,7 +91,6 @@ int pacman_add(list_t *targets)
case PM_ERR_UNSATISFIED_DEPS:
for(i = alpm_list_first(data); i; i = alpm_list_next(i)) {
PM_DEPMISS *miss = alpm_list_getdata(i);
-
MSG(NL, ":: %s: requires %s", alpm_dep_getinfo(miss, PM_DEP_TARGET),
alpm_dep_getinfo(miss, PM_DEP_NAME));
switch((int)alpm_dep_getinfo(miss, PM_DEP_MOD)) {
@@ -106,7 +105,6 @@ int pacman_add(list_t *targets)
case PM_ERR_CONFLICTING_DEPS:
for(i = alpm_list_first(data); i; i = alpm_list_next(i)) {
PM_DEPMISS *miss = alpm_list_getdata(i);
-
MSG(NL, ":: %s: conflicts with %s",
alpm_dep_getinfo(miss, PM_DEP_TARGET), alpm_dep_getinfo(miss, PM_DEP_NAME));
}
@@ -114,7 +112,20 @@ int pacman_add(list_t *targets)
break;
case PM_ERR_FILE_CONFLICTS:
for(i = alpm_list_first(data); i; i = alpm_list_next(i)) {
- MSG(NL, ":: %s", (char *)alpm_list_getdata(i));
+ PM_CONFLICT *conflict = alpm_list_getdata(i);
+ switch((int)alpm_conflict_getinfo(conflict, PM_CONFLICT_TYPE)) {
+ case PM_CONFLICT_TYPE_TARGET:
+ MSG(NL, "%s exists in \"%s\" (target) and \"%s\" (target)",
+ (char *)alpm_conflict_getinfo(conflict, PM_CONFLICT_FILE),
+ (char *)alpm_conflict_getinfo(conflict, PM_CONFLICT_TARGET),
+ (char *)alpm_conflict_getinfo(conflict, PM_CONFLICT_CTARGET));
+ break;
+ case PM_CONFLICT_TYPE_FILE:
+ MSG(NL, "%s: %s exists in filesystem",
+ (char *)alpm_conflict_getinfo(conflict, PM_CONFLICT_TARGET),
+ (char *)alpm_conflict_getinfo(conflict, PM_CONFLICT_FILE));
+ break;
+ }
}
alpm_list_free(data);
MSG(NL, "\nerrors occurred, no packages were upgraded.\n");
diff --git a/src/pacman/sync.c b/src/pacman/sync.c
index d9463a87..c46cf7b3 100644
--- a/src/pacman/sync.c
+++ b/src/pacman/sync.c
@@ -766,7 +766,20 @@ int pacman_sync(list_t *targets)
switch(pm_errno) {
case PM_ERR_FILE_CONFLICTS:
for(lp = alpm_list_first(data); lp; lp = alpm_list_next(lp)) {
- MSG(NL, ":: %s\n", (char *)alpm_list_getdata(lp));
+ PM_CONFLICT *conflict = alpm_list_getdata(i);
+ switch((int)alpm_conflict_getinfo(conflict, PM_CONFLICT_TYPE)) {
+ case PM_CONFLICT_TYPE_TARGET:
+ MSG(NL, "%s exists in \"%s\" (target) and \"%s\" (target)",
+ (char *)alpm_conflict_getinfo(conflict, PM_CONFLICT_FILE),
+ (char *)alpm_conflict_getinfo(conflict, PM_CONFLICT_TARGET),
+ (char *)alpm_conflict_getinfo(conflict, PM_CONFLICT_CTARGET));
+ break;
+ case PM_CONFLICT_TYPE_FILE:
+ MSG(NL, "%s: %s exists in filesystem",
+ (char *)alpm_conflict_getinfo(conflict, PM_CONFLICT_TARGET),
+ (char *)alpm_conflict_getinfo(conflict, PM_CONFLICT_FILE));
+ break;
+ }
}
alpm_list_free(data);
MSG(NL, "\nerrors occurred, no packages were upgraded.\n");