Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 70668 - [PATCH] dispatch-conf and etc-update to use colours
Summary: [PATCH] dispatch-conf and etc-update to use colours
Status: RESOLVED WORKSFORME
Alias: None
Product: Portage Development
Classification: Unclassified
Component: Tools (show other bugs)
Hardware: All All
: High enhancement (vote)
Assignee: Portage team
URL:
Whiteboard:
Keywords:
Depends on: 93874
Blocks:
  Show dependency tree
 
Reported: 2004-11-10 07:46 UTC by Andrew Conkling
Modified: 2015-02-13 13:13 UTC (History)
3 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
Patch to add colors to '#) file' lines in etc-update (etc-update.diff,859 bytes, patch)
2004-11-15 11:48 UTC, Matti Rendahl
Details | Diff
Once more, this time binary so it can be used... (etc-update.diff,859 bytes, application/octet-stream)
2004-11-15 11:52 UTC, Matti Rendahl
Details
etc-update-coloured.diff (etc-update-coloured.diff,10.51 KB, patch)
2005-01-05 06:19 UTC, David Cooper
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Andrew Conkling 2004-11-10 07:46:00 UTC
It would be quite beneficial if dispatch-conf and etc-update used colours; it's very hard (especially with the former) to see exactly where one file ends and another begins.  Even just one different colour for the headers would be great.
Comment 1 Matti Rendahl 2004-11-15 11:48:06 UTC
Created attachment 44011 [details, diff]
Patch to add colors to '#) file' lines in etc-update

I use this patch to make it easier to see what files etc-update lists. No fancy
commandlines, just color, 'NOCOLOR=1 etc-update' will turn off color. Probably
should go into /etc/etc-update.conf...
Comment 2 Matti Rendahl 2004-11-15 11:52:15 UTC
Created attachment 44012 [details]
Once more, this time binary so it can be used...

adds colors to etc-update (now patch should work)
Comment 3 Jean-François Gagnon Laporte 2004-11-18 08:57:38 UTC
AFAIK, you can already use colors in dispatch-conf by using colordiff (available in portage) instead of the regular diff. Here's a snippet of my config file :

diff="colordiff -Nu %s %s"
Comment 4 Andrew Conkling 2004-11-18 10:37:41 UTC
Thanks, I'll check that out but I was talking about colouring the dispatch-conf parts of the program, namely the headers before the diffs.
Comment 5 David Cooper 2005-01-05 06:19:18 UTC
Created attachment 47702 [details, diff]
etc-update-coloured.diff

I agree, but I think a more comprehensive visual revamp would be useful.

I've made an attempt at one for etc-update (attached), in which I've added
colours, changed the formatting and hopefully made the messages a bit clearer.
Comment 6 Jakub Moc (RETIRED) gentoo-dev 2005-03-05 23:57:11 UTC
I tried colordiff with dispatch-conf but it broke it...
Comment 7 Jason Stubbs (RETIRED) gentoo-dev 2005-07-28 07:24:43 UTC
Putting a hold on feature requests for portage as they are drowning out the 
bugs. Most of these features should be available in the next major version of 
portage. But for the time being, they are just drowning out the major bugs and 
delaying the next version's progress. 
 
Any bugs that contain patches and any bugs for etc-update or dispatch-conf can 
be reopened. Sorry, I'm just not good enough with bugzilla. ;) 
Comment 8 Marius Mauch (RETIRED) gentoo-dev 2007-01-11 14:04:44 UTC
Reopening for consideration.
Comment 9 Rob Clark 2007-02-22 08:24:33 UTC
I think its a good idea to have these colours(colors) in etc-update.

As suggested by others there are alternative ways to do this, but having it in the default configuration would be beneficial in my opinion :-)

Cheers
-Rob

Comment 10 jieryn 2008-08-09 16:12:07 UTC
> As suggested by others there are alternative ways to do this, but having it in
> the default configuration would be beneficial in my opinion :-)

It really breaks the whole UNIX philosophy thing though. colordiff already provides this exact functionality and does so in a manner more in line with the do one thing and do it very well principle.

Please do not add direct color support.
Comment 11 Matija "hook" Šuklje 2011-05-17 22:40:52 UTC
For what it's worth, I've been using colordiff with dispatch-conf for years and it works just fine.
Comment 12 Zac Medico gentoo-dev 2011-05-17 23:42:56 UTC
(In reply to comment #0)
> It would be quite beneficial if dispatch-conf and etc-update used colours; it's
> very hard (especially with the former) to see exactly where one file ends and
> another begins.  Even just one different colour for the headers would be great.

This sounds like the same issue as bug 142508. Am I correct? If so, it's already fixed for dispatch-conf by clearing the screen here:

http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=cecf7ccc10fbbeeaa8c9f72b359fd0a561d3bbbd

Looking at the current version of etc-update, I don't see any "clear" calls, so maybe we need to do the same thing there.
Comment 13 Zac Medico gentoo-dev 2011-05-18 03:52:12 UTC
I've added some "clear" calls to wipe the terminal, similar to the solution from bug 142508:

http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=5cfba96ca932266c7b50c9e432f13dd858e031db

If anybody still wants the color patch, please rebase on the latest version in git.
Comment 14 Tianon 2014-08-01 20:05:09 UTC
Just to provide another solution I've been using recently that's fun, "git diff" can take file arguments without them being in git repos, which if used here provides nice coloring by default (and I'd guess that more people have "git" installed already than have "colordiff"):

diff="git diff '%s' '%s'"
Comment 15 Alexander Berntsen (RETIRED) gentoo-dev 2015-02-13 13:13:10 UTC
Let's keep it UNIX, like jieryn said.