summaryrefslogtreecommitdiff
path: root/src/pacman/remove.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/pacman/remove.c')
-rw-r--r--src/pacman/remove.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/src/pacman/remove.c b/src/pacman/remove.c
index 6da3b044..8de538c8 100644
--- a/src/pacman/remove.c
+++ b/src/pacman/remove.c
@@ -39,7 +39,8 @@ static int remove_target(const char *target)
if((info = alpm_db_get_pkg(db_local, target)) != NULL) {
if(alpm_remove_pkg(config->handle, info) == -1) {
- pm_fprintf(stderr, PM_LOG_ERROR, "'%s': %s\n", target, alpm_strerrorlast());
+ pm_fprintf(stderr, PM_LOG_ERROR, "'%s': %s\n", target,
+ alpm_strerror(alpm_errno(config->handle)));
return -1;
}
return 0;
@@ -54,7 +55,8 @@ static int remove_target(const char *target)
for(p = alpm_grp_get_pkgs(grp); p; p = alpm_list_next(p)) {
pmpkg_t *pkg = alpm_list_getdata(p);
if(alpm_remove_pkg(config->handle, pkg) == -1) {
- pm_fprintf(stderr, PM_LOG_ERROR, "'%s': %s\n", target, alpm_strerrorlast());
+ pm_fprintf(stderr, PM_LOG_ERROR, "'%s': %s\n", target,
+ alpm_strerror(alpm_errno(config->handle)));
return -1;
}
}
@@ -100,9 +102,10 @@ int pacman_remove(alpm_list_t *targets)
/* Step 2: prepare the transaction based on its type, targets and flags */
if(alpm_trans_prepare(config->handle, &data) == -1) {
+ enum _pmerrno_t err = alpm_errno(config->handle);
pm_fprintf(stderr, PM_LOG_ERROR, _("failed to prepare transaction (%s)\n"),
- alpm_strerrorlast());
- switch(pm_errno) {
+ alpm_strerror(err));
+ switch(err) {
case PM_ERR_PKG_INVALID_ARCH:
for(i = data; i; i = alpm_list_next(i)) {
char *pkg = alpm_list_getdata(i);
@@ -164,7 +167,7 @@ int pacman_remove(alpm_list_t *targets)
if(alpm_trans_commit(config->handle, NULL) == -1) {
pm_fprintf(stderr, PM_LOG_ERROR, _("failed to commit transaction (%s)\n"),
- alpm_strerrorlast());
+ alpm_strerror(alpm_errno(config->handle)));
retval = 1;
}