mirror of
https://github.com/moparisthebest/pacman
synced 2024-08-13 17:03:46 -04:00
pacman_sync: handle trans_prepare error cases (patch from VMiklos <vmiklos@frugalware.org>)
This commit is contained in:
parent
db8a5e3586
commit
7dfe0ca0ae
@ -518,6 +518,34 @@ int pacman_sync(list_t *targets)
|
|||||||
/* Step 2: "compute" the transaction based on targets and flags */
|
/* Step 2: "compute" the transaction based on targets and flags */
|
||||||
if(alpm_trans_prepare(&data) == -1) {
|
if(alpm_trans_prepare(&data) == -1) {
|
||||||
ERR(NL, "failed to prepare transaction (%s)\n", alpm_strerror(pm_errno));
|
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;
|
retval = 1;
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user