summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorChantry Xavier <shiningxc@gmail.com>2008-02-03 01:12:33 +0100
committerDan McGee <dan@archlinux.org>2008-02-03 01:55:24 +0100
commit96ee1bca2473ea32d647db0464653424e34b1e91 (patch)
tree2ce664c5aeb149218fce40a0c752e233a09e976a /src
parent37bb99abfa5672e101e34579882e22c7a1016a9b (diff)
downloadpacman-96ee1bca2473ea32d647db0464653424e34b1e91.tar.gz
pacman-96ee1bca2473ea32d647db0464653424e34b1e91.tar.xz
Clarify the "failed to add target" errors.
Make the error message printed when addtarget fails consistent between add.c, remove.c and sync.c. The main problem was that the "failed to add target" in case of a removal operation could sound confusing. There was also a little output problem with -U ("failed" was missing). Signed-off-by: Chantry Xavier <shiningxc@gmail.com> Signed-off-by: Dan McGee <dan@archlinux.org>
Diffstat (limited to 'src')
-rw-r--r--src/pacman/add.c5
-rw-r--r--src/pacman/remove.c4
-rw-r--r--src/pacman/sync.c2
3 files changed, 6 insertions, 5 deletions
diff --git a/src/pacman/add.c b/src/pacman/add.c
index 975d26be..debe5c47 100644
--- a/src/pacman/add.c
+++ b/src/pacman/add.c
@@ -115,8 +115,9 @@ int pacman_add(alpm_list_t *targets)
for(i = targets; i; i = alpm_list_next(i)) {
char *targ = alpm_list_getdata(i);
if(alpm_trans_addtarget(targ) == -1) {
- fprintf(stderr, _("error: failed to add target '%s' (%s)"), targ,
- alpm_strerrorlast());
+ printf("failed.\n");
+ fprintf(stderr, _("error: '%s': %s\n"),
+ targ, alpm_strerrorlast());
add_cleanup();
return(1);
}
diff --git a/src/pacman/remove.c b/src/pacman/remove.c
index 56837fa2..0722057f 100644
--- a/src/pacman/remove.c
+++ b/src/pacman/remove.c
@@ -108,8 +108,8 @@ int pacman_remove(alpm_list_t *targets)
char *targ = alpm_list_getdata(i);
if(alpm_trans_addtarget(targ) == -1) {
printf("failed.\n");
- fprintf(stderr, _("error: failed to add target '%s' (%s)\n"), targ,
- alpm_strerrorlast());
+ fprintf(stderr, _("error: '%s': %s\n"),
+ targ, alpm_strerrorlast());
remove_cleanup();
FREELIST(finaltargs);
return(1);
diff --git a/src/pacman/sync.c b/src/pacman/sync.c
index 582192a4..27218d61 100644
--- a/src/pacman/sync.c
+++ b/src/pacman/sync.c
@@ -568,7 +568,7 @@ static int sync_trans(alpm_list_t *targets, int sync_only)
}
if(pm_errno != PM_ERR_PKG_NOT_FOUND) {
fprintf(stderr, _("error: '%s': %s\n"),
- (char *)i->data, alpm_strerrorlast());
+ targ, alpm_strerrorlast());
retval = 1;
goto cleanup;
}