summaryrefslogtreecommitdiffstats
path: root/src/pacman/sync.c
diff options
context:
space:
mode:
authorXavier Chantry <shiningxc@gmail.com>2009-07-15 19:14:01 +0200
committerDan McGee <dan@archlinux.org>2009-09-09 05:17:41 +0200
commit8ff3b87066d35d3518a3cd0bef27b86c3a85e983 (patch)
treea91691dccfa92d3021229f263b616ca4e35b5deb /src/pacman/sync.c
parent0da96abc900560f21c643b255c94a60232f4a24b (diff)
downloadpacman-8ff3b87066d35d3518a3cd0bef27b86c3a85e983.tar.gz
pacman-8ff3b87066d35d3518a3cd0bef27b86c3a85e983.tar.xz
Remove transaction type
This basically started with this change : /* Transaction */ struct __pmtrans_t { - pmtranstype_t type; pmtransflag_t flags; pmtransstate_t state; - alpm_list_t *packages; /* list of (pmpkg_t *) */ + alpm_list_t *add; /* list of (pmpkg_t *) */ + alpm_list_t *remove; /* list of (pmpkg_t *) */ And then I have to modify all the code accordingly.
Diffstat (limited to 'src/pacman/sync.c')
-rw-r--r--src/pacman/sync.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/src/pacman/sync.c b/src/pacman/sync.c
index a1d407c0..180fbb40 100644
--- a/src/pacman/sync.c
+++ b/src/pacman/sync.c
@@ -242,7 +242,7 @@ static int sync_synctree(int level, alpm_list_t *syncs)
alpm_list_t *i;
int success = 0, ret;
- if(trans_init(PM_TRANS_TYPE_SYNC, 0) == -1) {
+ if(trans_init(0) == -1) {
return(0);
}
@@ -552,7 +552,7 @@ static int process_target(char *targ, alpm_list_t *targets)
{
alpm_list_t *sync_dbs = alpm_option_get_syncdbs();
- if(alpm_trans_addtarget(targ) == -1) {
+ if(alpm_trans_sync(targ) == -1) {
pmgrp_t *grp = NULL;
int found = 0;
alpm_list_t *j;
@@ -617,7 +617,7 @@ static int sync_trans(alpm_list_t *targets)
alpm_list_t *i;
/* Step 1: create a new transaction... */
- if(trans_init(PM_TRANS_TYPE_SYNC, config->flags) == -1) {
+ if(trans_init(config->flags) == -1) {
return(1);
}
@@ -683,7 +683,7 @@ static int sync_trans(alpm_list_t *targets)
goto cleanup;
}
- packages = alpm_trans_get_pkgs();
+ packages = alpm_trans_get_add();
if(packages == NULL) {
/* nothing to do: just exit without complaining */
printf(_(" local database is up to date\n"));
@@ -711,7 +711,8 @@ static int sync_trans(alpm_list_t *targets)
goto cleanup;
}
- display_synctargets(packages);
+ display_targets(alpm_trans_get_remove(), 0);
+ display_targets(alpm_trans_get_add(), 1);
printf("\n");
int confirm;
@@ -788,7 +789,7 @@ int pacman_sync(alpm_list_t *targets)
if(config->op_s_clean) {
int ret = 0;
- if(trans_init(PM_TRANS_TYPE_SYNC, 0) == -1) {
+ if(trans_init(0) == -1) {
return(1);
}