[pacman-dev] Pacman output issues

Dan McGee dpmcgee at gmail.com
Mon Oct 8 15:10:03 EDT 2007

A few questions to pose to the list before I make changes that need to
be made since I busted some things up with the last few updates of
pacman output trying to make it simpler.

1. What information should go to stdout, and what information should
go to stderr? I really should look at how it is done in the current
3.0 branch so I can get it right going forward in 3.1, but I want to
make sure that what was done in 3.0 is right according to the list. I
would think something like this:
* non-essential info (progress meters and the like): stdout
* list of packages to be upgraded, Y/n questions: this probably should
go to stdout, but has gone to stderr in the past so that redirection
of stdout works and users still see questions, and pacman doesn't seem
to hang without reason. Thoughts?
* "package is newer than...": stdout
* errors/warnings: stderr

2. I introduced the pm_printf family of functions a while back but
didn't switch much of the pacman output over to it. It mainly deals
with not having to duplicate the use of "warning:" and "error:", etc
in the code. Any reason not to use this as often as possible in the
pacman code? I plan on doing this; I just want to first make sure I'm
not making a stupid mistake. Obviously not everything will get
switched (usage and help come to mind as being plain printf
candidates), but I think just about everything else should go. My only
thought holding me back is the fact that the error level codes are in
libalpm and not the frontend, which may be a non-issue.

3. I broke the newline stuff. If a progress bar is going and some
output needs to be placed on the screen, it doesn't end up on the next
line. I'd really like a clean way to fix this- the old global variable
way seemed very weird to me, or at least it was too complex. I have
one idea in my head, but haven't sat down and tried it yet.


More information about the pacman-dev mailing list