summaryrefslogtreecommitdiff
path: root/lib/libalpm/trans.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/libalpm/trans.c')
-rw-r--r--lib/libalpm/trans.c14
1 files changed, 12 insertions, 2 deletions
diff --git a/lib/libalpm/trans.c b/lib/libalpm/trans.c
index 7bd37e1f..6e278cd7 100644
--- a/lib/libalpm/trans.c
+++ b/lib/libalpm/trans.c
@@ -61,7 +61,12 @@ void trans_free(pmtrans_t *trans)
}
FREELIST(trans->targets);
- FREELISTPKGS(trans->packages);
+ /* ORE - ugly */
+ if(trans->type == PM_TRANS_TYPE_SYNC) {
+ FREELISTPTR(trans->packages);
+ } else {
+ FREELISTPKGS(trans->packages);
+ }
free(trans);
}
@@ -109,9 +114,14 @@ int trans_addtarget(pmtrans_t *trans, char *target)
return(-1);
}
break;
+ case PM_TRANS_TYPE_SYNC:
+ if(sync_addtarget(handle->db_local, handle->dbs_sync, trans, target) == -1) {
+ /* pm_errno is set by add_loadtarget() */
+ return(-1);
+ }
+ break;
}
trans->targets = pm_list_add(trans->targets, strdup(target));
- trans->state = STATE_INITIALIZED;
return(0);
}