summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAurelien Foret <aurelien@archlinux.org>2006-01-06 23:14:21 +0000
committerAurelien Foret <aurelien@archlinux.org>2006-01-06 23:14:21 +0000
commit7dfe0ca0aebd7fedbcf8b3753559da831e29c05d (patch)
tree2effd4036db8443e3fe3114be75ba103cdc4ae9f
parentdb8a5e358617038b3e884a13462a4f0163b56cc5 (diff)
downloadpacman-7dfe0ca0aebd7fedbcf8b3753559da831e29c05d.tar.xz
pacman_sync: handle trans_prepare error cases (patch from VMiklos <vmiklos@frugalware.org>)
-rw-r--r--src/pacman/sync.c28
1 files changed, 28 insertions, 0 deletions
diff --git a/src/pacman/sync.c b/src/pacman/sync.c
index 3e29568b..0cdb8806 100644
--- a/src/pacman/sync.c
+++ b/src/pacman/sync.c
@@ -518,6 +518,34 @@ int pacman_sync(list_t *targets)
/* Step 2: "compute" the transaction based on targets and flags */
if(alpm_trans_prepare(&data) == -1) {
ERR(NL, "failed to prepare transaction (%s)\n", alpm_strerror(pm_errno));
+ switch(pm_errno) {
+ case PM_ERR_UNSATISFIED_DEPS:
+ for(lp = alpm_list_first(data); lp; lp = alpm_list_next(lp)) {
+ PM_DEPMISS *miss = alpm_list_getdata(lp);
+
+ 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)) {
+ case PM_DEP_MOD_EQ: MSG(CL, "=%s", alpm_dep_getinfo(miss, PM_DEP_VERSION)); break;
+ case PM_DEP_MOD_GE: MSG(CL, ">=%s", alpm_dep_getinfo(miss, PM_DEP_VERSION)); break;
+ case PM_DEP_MOD_LE: MSG(CL, "<=%s", alpm_dep_getinfo(miss, PM_DEP_VERSION)); break;
+ }
+ MSG(CL, "\n");
+ }
+ alpm_list_free(data);
+ break;
+ case PM_ERR_CONFLICTING_DEPS:
+ for(lp = alpm_list_first(data); lp; lp = alpm_list_next(lp)) {
+ PM_DEPMISS *miss = alpm_list_getdata(lp);
+
+ MSG(NL, ":: %s: conflicts with %s", alpm_dep_getinfo(miss, PM_DEP_TARGET),
+ alpm_dep_getinfo(miss, PM_DEP_NAME));
+ }
+ alpm_list_free(data);
+ break;
+ default:
+ break;
+ }
retval = 1;
goto cleanup;
}