1
0
mirror of https://github.com/moparisthebest/pacman synced 2024-11-11 03:54:59 -05:00

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>
This commit is contained in:
Chantry Xavier 2008-02-03 01:12:33 +01:00 committed by Dan McGee
parent 37bb99abfa
commit 96ee1bca24
3 changed files with 6 additions and 5 deletions

View File

@ -115,8 +115,9 @@ int pacman_add(alpm_list_t *targets)
for(i = targets; i; i = alpm_list_next(i)) { for(i = targets; i; i = alpm_list_next(i)) {
char *targ = alpm_list_getdata(i); char *targ = alpm_list_getdata(i);
if(alpm_trans_addtarget(targ) == -1) { if(alpm_trans_addtarget(targ) == -1) {
fprintf(stderr, _("error: failed to add target '%s' (%s)"), targ, printf("failed.\n");
alpm_strerrorlast()); fprintf(stderr, _("error: '%s': %s\n"),
targ, alpm_strerrorlast());
add_cleanup(); add_cleanup();
return(1); return(1);
} }

View File

@ -108,8 +108,8 @@ int pacman_remove(alpm_list_t *targets)
char *targ = alpm_list_getdata(i); char *targ = alpm_list_getdata(i);
if(alpm_trans_addtarget(targ) == -1) { if(alpm_trans_addtarget(targ) == -1) {
printf("failed.\n"); printf("failed.\n");
fprintf(stderr, _("error: failed to add target '%s' (%s)\n"), targ, fprintf(stderr, _("error: '%s': %s\n"),
alpm_strerrorlast()); targ, alpm_strerrorlast());
remove_cleanup(); remove_cleanup();
FREELIST(finaltargs); FREELIST(finaltargs);
return(1); return(1);

View File

@ -568,7 +568,7 @@ static int sync_trans(alpm_list_t *targets, int sync_only)
} }
if(pm_errno != PM_ERR_PKG_NOT_FOUND) { if(pm_errno != PM_ERR_PKG_NOT_FOUND) {
fprintf(stderr, _("error: '%s': %s\n"), fprintf(stderr, _("error: '%s': %s\n"),
(char *)i->data, alpm_strerrorlast()); targ, alpm_strerrorlast());
retval = 1; retval = 1;
goto cleanup; goto cleanup;
} }