From d060e31be3586ce27382f80eaed7a9edf2c86aeb Mon Sep 17 00:00:00 2001 From: Nagy Gabor Date: Mon, 10 Mar 2008 15:38:08 +0100 Subject: Remove trans->targets Its implementation was quite broken: * add_loadtarget() might have silently filtered out some targets when replacing an older version. * This was used in sync.c to determine whether a target is implicit or not, which is incorrect behavior. Before this patch we silently removed user confirmed replacements; now we always warn on a replacement. * remove001.py behavior was quite odd in adding same target 5 times to the target list, we can change this behavior to be a failure. Signed-off-by: Nagy Gabor [Xav: changed remove001 pactest accordingly] Signed-off-by: Chantry Xavier [Dan: rewrote commit message] Signed-off-by: Dan McGee --- lib/libalpm/trans.c | 18 ------------------ 1 file changed, 18 deletions(-) (limited to 'lib/libalpm/trans.c') diff --git a/lib/libalpm/trans.c b/lib/libalpm/trans.c index 52dbe7a9..5836df5a 100644 --- a/lib/libalpm/trans.c +++ b/lib/libalpm/trans.c @@ -228,7 +228,6 @@ pmtrans_t *_alpm_trans_new() CALLOC(trans, 1, sizeof(pmtrans_t), RET_ERR(PM_ERR_MEMORY, NULL)); - trans->targets = NULL; trans->packages = NULL; trans->skip_add = NULL; trans->skip_remove = NULL; @@ -250,7 +249,6 @@ void _alpm_trans_free(pmtrans_t *trans) return; } - FREELIST(trans->targets); if(trans->type == PM_TRANS_TYPE_SYNC) { alpm_list_free_inner(trans->packages, (alpm_list_fn_free)_alpm_sync_free); } else if (trans->type == PM_TRANS_TYPE_REMOVE || @@ -308,11 +306,6 @@ int _alpm_trans_addtarget(pmtrans_t *trans, char *target) ASSERT(trans != NULL, RET_ERR(PM_ERR_TRANS_NULL, -1)); ASSERT(target != NULL, RET_ERR(PM_ERR_WRONG_ARGS, -1)); - if(alpm_list_find_str(trans->targets, target)) { - return(0); - //RET_ERR(PM_ERR_TRANS_DUP_TARGET, -1); - } - switch(trans->type) { case PM_TRANS_TYPE_ADD: case PM_TRANS_TYPE_UPGRADE: @@ -336,8 +329,6 @@ int _alpm_trans_addtarget(pmtrans_t *trans, char *target) break; } - trans->targets = alpm_list_add(trans->targets, strdup(target)); - return(0); } @@ -637,15 +628,6 @@ unsigned int SYMEXPORT alpm_trans_get_flags() return handle->trans->flags; } -alpm_list_t SYMEXPORT * alpm_trans_get_targets() -{ - /* Sanity checks */ - ASSERT(handle != NULL, return(NULL)); - ASSERT(handle->trans != NULL, return(NULL)); - - return handle->trans->targets; -} - alpm_list_t SYMEXPORT * alpm_trans_get_pkgs() { /* Sanity checks */ -- cgit v1.2.3-24-g4f1b