Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 433974

Summary: app-portage/gentoolkit - add '--color' switch in utilities
Product: Portage Development Reporter: trismarck
Component: ToolsAssignee: Portage Tools Team <tools-portage>
Status: RESOLVED FIXED    
Severity: enhancement    
Priority: Normal    
Version: unspecified   
Hardware: All   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---
Bug Depends on:    
Bug Blocks: 346443    

Description trismarck 2012-09-05 00:09:16 UTC
Hi,

would it be possible to add a --color switch to programs like 'equery' inside the gentoolkit package, so, if the output of the program is redirected to a pipe, that program would properly encode coloring into the pipe?
I.e.
equery list mc | less -r

This will currently display the output of the equery command without coloring the output.
Note that 'emerge' already has a '--color y' switch.

Related thread: http://forums.gentoo.org/viewtopic-t-26349.html
Comment 1 Brian Dolbec (RETIRED) gentoo-dev 2012-09-06 06:20:22 UTC
Set the -N, switch to turn off pipe detection.  But that usually also changes the output, since output is usually quieted some for pipes as compared to normal output.  But using -N will turn colors back on.

equery -N list mc | less -r
Comment 2 trismarck 2012-09-06 13:59:23 UTC
Hi Brian,

this is the effect of the '--no-pipe' switch:
http://imgur.com/qwq0M

I'm using equery-0.3.0.6-r3.
Comment 3 Brian Dolbec (RETIRED) gentoo-dev 2012-09-06 14:24:58 UTC
Since you don't have it installed (equery default, search only installed pkgs) you need to add the -p switch for list so it searches the entire portage tree.

equery -N list -p mc | less -r
Comment 4 trismarck 2012-09-06 18:26:28 UTC
I know I don't have it installed, I just wanted to show you that colors are not working :) .
Comment 5 Brian Dolbec (RETIRED) gentoo-dev 2012-09-07 02:41:02 UTC
Yes, we saw it wasn't.  We both wrongly thought the -N switch restored colors.

Anyway, Paul Varner fixed it today.  So if you use the the -N switch but don't want colors, you will need to also add the -C switch to turn them off.

fixed in commit:
http://git.overlays.gentoo.org/gitweb/?p=proj/gentoolkit.git;a=commit;h=e2e77301eb234aecfa5160d0de7bfda7bbe38a64

You can get the change now by emerging gentoolkit-9999.

There are a few more small changes/bugfixes since -0.3.0.6-r3.  Do not worry it will be too unstable, we have not yet started work on changes for -0.3.1.
Comment 6 Paul Varner (RETIRED) gentoo-dev 2012-09-07 14:51:35 UTC
Actually there is one unstable change in gentoolkit-9999.  revdep-rebuild is a new python version which can miss things.  To be safe, you can run revdep-rebuild.sh which is the stable bash version of revdep-rebuild.  Other than that, gentoolkit-9999 is very close to the current stable version of gentoolkit.
Comment 7 Paul Varner (RETIRED) gentoo-dev 2012-11-06 17:37:20 UTC
Released in gentoolkit-0.3.0.7