summaryrefslogtreecommitdiff
path: root/lib/libalpm/trans.c
diff options
context:
space:
mode:
authorAurelien Foret <aurelien@archlinux.org>2005-03-30 22:32:43 +0000
committerAurelien Foret <aurelien@archlinux.org>2005-03-30 22:32:43 +0000
commit4d21e4f721077387734c8f77017e0dba8a95a14b (patch)
treed47779158c1dfaacd26cb6bdaedfc109c1eb9f5d /lib/libalpm/trans.c
parentb009c5bafa63581a0c590a8c1a1d8dafd5e7654a (diff)
downloadpacman-4d21e4f721077387734c8f77017e0dba8a95a14b.tar.xz
started the work on "pacman_sync"
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);
}