index : pacman | |
Archlinux32 fork of pacman | gitolite user |
summaryrefslogtreecommitdiff |
author | Nagy Gabor <ngaba@bibl.u-szeged.hu> | 2008-01-25 21:52:35 +0100 |
---|---|---|
committer | Dan McGee <dan@archlinux.org> | 2008-01-27 11:54:35 -0600 |
commit | 9bfbd739176ebc41e4ec93dcd21264b87640aa5b (patch) | |
tree | ef043eb9b7b1de2e4538ffea9e92a027d662a8ff /lib/libalpm/sync.c | |
parent | ea828b5693d389d24c744841385b16cb37a32fce (diff) |
-rw-r--r-- | lib/libalpm/sync.c | 27 |
diff --git a/lib/libalpm/sync.c b/lib/libalpm/sync.c index 27b5454f..efdfa203 100644 --- a/lib/libalpm/sync.c +++ b/lib/libalpm/sync.c @@ -475,9 +475,17 @@ int _alpm_sync_prepare(pmtrans_t *trans, pmdb_t *db_local, alpm_list_t *dbs_sync rsync = sync1; sync = sync2; } else { + _alpm_log(PM_LOG_ERROR, _("unresolvable package conflicts detected\n")); pm_errno = PM_ERR_CONFLICTING_DEPS; ret = -1; - *data = deps; + if(data) { + pmconflict_t *newconflict = _alpm_conflict_dup(conflict); + if(newconflict) { + *data = alpm_list_add(*data, newconflict); + } + } + alpm_list_free_inner(deps, (alpm_list_fn_free)_alpm_conflict_free); + alpm_list_free(deps); goto cleanup; } @@ -542,21 +550,14 @@ int _alpm_sync_prepare(pmtrans_t *trans, pmdb_t *db_local, alpm_list_t *dbs_sync sync->data = alpm_list_add(sync->data, local); } else { /* abort */ _alpm_log(PM_LOG_ERROR, _("unresolvable package conflicts detected\n")); + pm_errno = PM_ERR_CONFLICTING_DEPS; + ret = -1; if(data) { - pmconflict_t *retconflict; - MALLOC(retconflict, sizeof(pmconflict_t), 0); - if(!retconflict) { - pm_errno = PM_ERR_MEMORY; - alpm_list_free_inner(*data, (alpm_list_fn_free)_alpm_conflict_free); - alpm_list_free(*data); - ret = -1; - goto cleanup; + pmconflict_t *newconflict = _alpm_conflict_dup(conflict); + if(newconflict) { + *data = alpm_list_add(*data, newconflict); } - *retconflict = *conflict; - *data = alpm_list_add(*data, retconflict); } - pm_errno = PM_ERR_CONFLICTING_DEPS; - ret = -1; alpm_list_free_inner(deps, (alpm_list_fn_free)_alpm_conflict_free); alpm_list_free(deps); goto cleanup; |