[pacman-dev] Colour support in pacman!

Simon Gomizelj simongmzlj at gmail.com
Fri Mar 1 16:32:29 EST 2013


Colourize pacman output!

This patchset duplicates about 95% of the colour support pacman-color
provides. I don't duplicate everything and I vary slightly in how
I colour certain messages to avoid massively restructuring pacman.

Its a good starting point which can be improved on. Work on improving
this means improving a lot of pacman's pretty printing code.

Anyhow...

Colours can be enabled in two ways:

- Add 'Color' to pacman.conf. This enables automatic colouring.
- Use --color=WHEN where WHEN is none/auto/always.

WHEN as 'never' disables colours (overrides config file), as 'auto'
enables colours when stdout is a tty, and 'always' enables colours no
matter what.

None disables colours (overrides config file), auto enables colours when
stdout is a tty, and always enables colours no matter what.

I do not read pacman-color's color.conf. Probably never will.

- We can't configure makepkg's colours
- The config file has _very_ strange semantics (eg Red = intensive red)

 doc/pacman.8.txt      |  3 ++
 doc/pacman.conf.5.txt |  3 ++
 etc/pacman.conf.in    |  1 +
 src/pacman/callback.c | 26 +++++++-------
 src/pacman/conf.c     | 52 +++++++++++++++++++++++++++
 src/pacman/conf.h     | 22 +++++++++++-
 src/pacman/package.c  | 91 ++++++++++++++++++++++++++++++++++++++++++-----
 src/pacman/package.h  |  3 ++
 src/pacman/pacman.c   | 15 ++++++++
 src/pacman/query.c    | 59 ++-----------------------------
 src/pacman/remove.c   |  2 +-
 src/pacman/sync.c     | 95 ++++++++-----------------------------------------
 src/pacman/util.c     | 98 ++++++++++++++++++++++++++++++++++++++-------------
 src/pacman/util.h     |  5 +--
 14 files changed, 289 insertions(+), 186 deletions(-)



More information about the pacman-dev mailing list