From 86e5c8bc0649a6df814bdff850a787826612f366 Mon Sep 17 00:00:00 2001 From: Aurelien Foret Date: Sat, 7 Jan 2006 18:42:44 +0000 Subject: sync_commit can now return conflicting files with a trans_prepare like data structure (patch from VMiklos ) --- src/pacman/add.c | 2 +- src/pacman/pacman.c | 2 +- src/pacman/remove.c | 2 +- src/pacman/sync.c | 13 ++++++++++++- 4 files changed, 15 insertions(+), 4 deletions(-) (limited to 'src/pacman') diff --git a/src/pacman/add.c b/src/pacman/add.c index fb6c4a58..10c618eb 100644 --- a/src/pacman/add.c +++ b/src/pacman/add.c @@ -122,7 +122,7 @@ int pacman_add(list_t *targets) /* Step 3: actually perform the installation */ - if(alpm_trans_commit() == -1) { + if(alpm_trans_commit(NULL) == -1) { ERR(NL, "failed to commit transaction (%s)\n", alpm_strerror(pm_errno)); return(1); } diff --git a/src/pacman/pacman.c b/src/pacman/pacman.c index 646f7e9e..e1dff655 100644 --- a/src/pacman/pacman.c +++ b/src/pacman/pacman.c @@ -89,7 +89,7 @@ int main(int argc, char *argv[]) return(1); } config->op = PM_OP_MAIN; - config->debug |= PM_LOG_WARNING | PM_LOG_ERROR; + config->debug |= PM_LOG_WARNING; /* parse the command line */ ret = parseargs(argc, argv); diff --git a/src/pacman/remove.c b/src/pacman/remove.c index 6dc3758c..b730dd9b 100644 --- a/src/pacman/remove.c +++ b/src/pacman/remove.c @@ -126,7 +126,7 @@ int pacman_remove(list_t *targets) /* Step 3: actually perform the removal */ - if(alpm_trans_commit() == -1) { + if(alpm_trans_commit(NULL) == -1) { ERR(NL, "failed to commit transaction (%s)\n", alpm_strerror(pm_errno)); goto error; } diff --git a/src/pacman/sync.c b/src/pacman/sync.c index 7a76dea0..74733e06 100644 --- a/src/pacman/sync.c +++ b/src/pacman/sync.c @@ -756,8 +756,19 @@ int pacman_sync(list_t *targets) } /* Step 3: actually perform the installation */ - if(alpm_trans_commit() == -1) { + if(alpm_trans_commit(&data) == -1) { ERR(NL, "failed to commit transaction (%s)\n", alpm_strerror(pm_errno)); + switch(pm_errno) { + case PM_ERR_FILE_CONFLICTS: + for(lp = alpm_list_first(data); lp; lp = alpm_list_next(lp)) { + MSG(NL, ":: %s\n", (char *)alpm_list_getdata(lp)); + } + alpm_list_free(data); + MSG(NL, "\nerrors occurred, no packages were upgraded.\n"); + break; + default: + break; + } retval = 1; goto cleanup; } -- cgit v1.2.3-70-g09d2