diff options
author | Stefano Esposito <stefano.esposito87@gmail.com> | 2007-09-08 18:41:45 +0200 |
---|---|---|
committer | Dan McGee <dan@archlinux.org> | 2007-09-12 03:58:27 +0200 |
commit | 27acdc2c94de558103eb29260c179a49c9b05c14 (patch) | |
tree | 969d73111d6a1943975fae23ac5ba5747bb6e0d2 /src/pacman/remove.c | |
parent | f21c45c0ddf195a4dcfca08c19bfa23d1c7fb326 (diff) | |
download | pacman-27acdc2c94de558103eb29260c179a49c9b05c14.tar.gz pacman-27acdc2c94de558103eb29260c179a49c9b05c14.tar.xz |
make alpm_strerror binding friendly
I'm currently working on python bindings for alpm written in pyrex. While
working i found that declaring alpm_strerror as
char * alpm_strerror (void)
instead of
char * alpm_strerror (int err)
and then using pm_errno in the implementation instead of err, could make it
more bindings-friendly.
Dan: cleaned up and added void to declaration. Instead of replacing existing
function, add a new function called 'alpm_strerrorlast(void)'.
Signed-off-by: Stefano Esposito <stefano.esposito87@gmail.com>
Signed-off-by: Dan McGee <dan@archlinux.org>
Diffstat (limited to 'src/pacman/remove.c')
-rw-r--r-- | src/pacman/remove.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/pacman/remove.c b/src/pacman/remove.c index e60d3e8c..860bf491 100644 --- a/src/pacman/remove.c +++ b/src/pacman/remove.c @@ -44,7 +44,7 @@ static int remove_cleanup(void) int ret = alpm_trans_release(); if(ret != 0) { pm_printf(PM_LOG_ERROR, _("failed to release transaction (%s)\n"), - alpm_strerror(pm_errno)); + alpm_strerrorlast()); ret = 1; } @@ -97,7 +97,7 @@ int pacman_remove(alpm_list_t *targets) if(alpm_trans_init(PM_TRANS_TYPE_REMOVE, config->flags, cb_trans_evt, cb_trans_conv, cb_trans_progress) == -1) { fprintf(stderr, _("error: failed to init transaction (%s)\n"), - alpm_strerror(pm_errno)); + alpm_strerrorlast()); if(pm_errno == PM_ERR_HANDLE_LOCK) { printf(_(" if you're sure a package manager is not already\n" " running, you can remove %s.\n"), alpm_option_get_lockfile()); @@ -113,7 +113,7 @@ int pacman_remove(alpm_list_t *targets) if(alpm_trans_addtarget(targ) == -1) { printf("failed.\n"); fprintf(stderr, _("error: failed to add target '%s' (%s)\n"), targ, - alpm_strerror(pm_errno)); + alpm_strerrorlast()); remove_cleanup(); FREELIST(finaltargs); return(1); @@ -123,7 +123,7 @@ int pacman_remove(alpm_list_t *targets) /* Step 2: prepare the transaction based on its type, targets and flags */ if(alpm_trans_prepare(&data) == -1) { fprintf(stderr, _("error: failed to prepare transaction (%s)\n"), - alpm_strerror(pm_errno)); + alpm_strerrorlast()); switch(pm_errno) { case PM_ERR_UNSATISFIED_DEPS: for(i = data; i; i = alpm_list_next(i)) { @@ -167,7 +167,7 @@ int pacman_remove(alpm_list_t *targets) /* Step 3: actually perform the removal */ if(alpm_trans_commit(NULL) == -1) { fprintf(stderr, _("error: failed to commit transaction (%s)\n"), - alpm_strerror(pm_errno)); + alpm_strerrorlast()); remove_cleanup(); FREELIST(finaltargs); return(1); |