From e59e963f1f1b1e0d42474f25d6564ec5e949bca1 Mon Sep 17 00:00:00 2001 From: Aurelien Foret Date: Wed, 6 Apr 2005 21:00:57 +0000 Subject: reverted back to trans->packages instead of install and remove queues --- lib/libalpm/trans.c | 21 ++++++--------------- 1 file changed, 6 insertions(+), 15 deletions(-) (limited to 'lib/libalpm/trans.c') diff --git a/lib/libalpm/trans.c b/lib/libalpm/trans.c index af0c6b7d..89f9a998 100644 --- a/lib/libalpm/trans.c +++ b/lib/libalpm/trans.c @@ -45,8 +45,7 @@ pmtrans_t *trans_new() } trans->targets = NULL; - trans->install_q = NULL; - trans->remove_q = NULL; + trans->packages = NULL; trans->type = 0; trans->flags = 0; trans->cb = NULL; @@ -62,19 +61,15 @@ void trans_free(pmtrans_t *trans) } FREELIST(trans->targets); - /* ORE - ugly */ if(trans->type == PM_TRANS_TYPE_SYNC) { - PMList *i = trans->install_q; - while(i) { - PMList *j = i->next; + PMList *i; + for(i = trans->packages; i; i = i->next) { sync_free(i->data); i->data = NULL; - pm_list_free(i); - i = j; } + FREELIST(trans->packages); } else { - FREELISTPKGS(trans->install_q); - FREELISTPKGS(trans->remove_q); + FREELISTPKGS(trans->packages); } free(trans); @@ -142,10 +137,6 @@ int trans_prepare(pmtrans_t *trans, PMList **data) /* Sanity checks */ ASSERT(trans != NULL, RET_ERR(PM_ERR_WRONG_ARGS, -1)); - if(trans->install_q == NULL && trans->remove_q == NULL) { - return(0); - } - switch(trans->type) { case PM_TRANS_TYPE_ADD: case PM_TRANS_TYPE_UPGRADE: @@ -179,7 +170,7 @@ int trans_commit(pmtrans_t *trans) ASSERT(trans != NULL, RET_ERR(PM_ERR_WRONG_ARGS, -1)); /* If there's nothing to do, return without complaining */ - if(trans->install_q == NULL && trans->remove_q == NULL) { + if(trans->packages == NULL) { return(0); } -- cgit v1.2.3