[pacman-dev] Questions about how to show messages (warnings, etc)

Olivier Brunel jjk at jjacky.com
Mon Dec 2 10:11:59 EST 2013


Hi,

So I'm working on changing the events callback as discussed earlier, and
I'm running into some little issues (discrepancies really) when it comes
to showing warnings/errors.

As you know, pacman can show warnings/errors to the user; and when
colors are used those prefixes will be shown in color. Except, not always.

There seems to be some inconsistency when it comes to this, because when
a warning/error needs to be shown, pacman can do one of two things:
- show it right away
- cache it and show it later, i.e. when the current progress will be done

Now, when shown right away, prefixes are in color, and messages are
shown on stderr.
However, when delayed, there will be no colors (because unlike
pm_vfprintf(), pm_vasprintf() doesn't add colors to the prefixes) *and*
messages will be shown on stdout.

Unless there's a reason for this I'm not aware of, I think that this
should probably be fixed, as in have delayed messages use colors & show
on stderr?

As a side note, the FS#37711 that Andrew mentioned previously was about
the lack of colors for creation of .pac* files, but it might actually
have been a manifestation of this bug/discrepancy (i.e. when fixed, or
if using --noprogressbar, one would have colors on those warnings already).

-j


More information about the pacman-dev mailing list