From 7dfe0ca0aebd7fedbcf8b3753559da831e29c05d Mon Sep 17 00:00:00 2001 From: Aurelien Foret Date: Fri, 6 Jan 2006 23:14:21 +0000 Subject: pacman_sync: handle trans_prepare error cases (patch from VMiklos ) --- src/pacman/sync.c | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) (limited to 'src/pacman') 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; } -- cgit v1.2.3-70-g09d2