[pacman-dev] [PATCH] Clarify the "failed to add target" errors.

Xavier shiningxc at gmail.com
Mon Feb 4 13:03:19 EST 2008

Nagy Gabor wrote:
> Hi!
> Well, this error message problem is not critical at all, but I don't like your
> preferred fix, because:
> - all "transaction steps" (init, release, addtarget, prepare, commit) use the
> same format now: "error: failed to foo transaction (ERRORLAST)\n" and the patch
> would break this simmetry.

I simply kept the sync.c message, and used the same for remove.c and 
add.c. So on this side, my patch makes it more consistent.
Maybe sync.c wasn't consistent in the first place, but well :P

> - I'm not sure that alpm_strerrorlast() is always informative and set properly

Then make it more informative :)

> - we can get the same ERRORLAST so foo can be helpful in debugging in these cases
> - Personally I liked this front-end + back-end error message "concatenation"
> So I prefer rephase this "failed to add target" message, Dan's suggestion seems
> OK to me: http://www.archlinux.org/pipermail/pacman-dev/2008-February/011045.html

So should I change in my patch from :
fprintf(stderr, _("error: '%s': %s\n"),
	targ, alpm_strerrorlast());
fprintf(stderr, _("error: failed to find target '%s' (%s)\n"),
	targ, alpm_strerrorlast());

for sync.c , remove.c and add.c ?

More information about the pacman-dev mailing list