FS#26555 - Issues with makepkg handling pacman errors

Attached to Project: Pacman
Opened by Pierre Schmitz (Pierre) - Friday, 21 October 2011, 15:18 GMT
Last edited by Dan McGee (toofishes) - Sunday, 13 November 2011, 19:32 GMT
Task Type Bug Report
Category General
Status Closed
Assigned To Dan McGee (toofishes)
Allan McRae (Allan)
Architecture All
Severity Low
Priority Normal
Reported Version 4.0.0
Due in Version 4.0.1
Due Date Undecided
Percent Complete 100%
Votes 0
Private No

Details

If pacman finds an error in its config file it prints a warning to stdout and returns a 0 value. I am not sure if this is by intention or an oversight.

However makepkg does not expect this behavior. For example it tries to get the dependency list by using the "-T" operator and pipes the result into "-S --asdeps". The result is the following error message:

==> Installing missing dependencies...
warning: config file /etc/pacman.conf, line 49: directive 'SigLevel' in section 'options' not recognized.
warning: config file /etc/pacman.conf, line 51: directive 'SigLevel' in section 'options' not recognized.
error: target not found: warning:
==> ERROR: 'pacman' failed to install missing dependencies.

No big deal, but ideally pacman should return anything else than 0 and print errors to stderr if possible. Especially since the -T operation is meant to be used from scripts.

PS: If I am not wrong both pacman 3.5 and 4.0 are affected by this.
This task depends upon

Closed by  Dan McGee (toofishes)
Sunday, 13 November 2011, 19:32 GMT
Reason for closing:  Fixed
Additional comments about closing:  Commit 45f86ca1ca712857e6
Comment by Dan McGee (toofishes) - Friday, 21 October 2011, 15:32 GMT
This change was made in commit 3707d5bc468dc.

1. No, this will never affect the exit code of pacman. That was a primary reason for this commit.
2. Patches welcome for stderr in the frontend. We did the backend error messages this time around but unfortunately the frontend is a mess and mix of various message printing calling conventions that will need some manual work in cleaning up. At the very least we can switch this one message to be stderr.

Yes, pacman 3.5.1 and newer are affected (not 3.5.0). `git tag --contains 3707d5bc468dc`.

Loading...