View previous topic :: View next topic |
Author |
Message |
ph317 n00b
Joined: 02 Jun 2002 Posts: 43
|
Posted: Mon Jul 08, 2002 9:21 pm Post subject: emerge options |
|
|
Is there any chance portage could be made less human-freindly and more commandline tool friendly? I dislike from a design perspective that commands like "emerge" output ANSI color codes and human-formatted drivel. For example, it's really frustrating to "emerge -s blah | less" to page it out and get a screenfull of ANSI codes making it impossible to read.
I would suggest two output modes. The "normal" output mode currently in use, and a "machine" or "quiet" output mode. The latter should:
1) Get rid of ANSI color codes and the like
2) Never do things like the 5 second countdown timer of unmerge/clean
3) Only print concise, pertinent output, one record per line, in a format easy to work with for grep/sed/awk/perl/python/etc (whatever your choice of processing tool might be). One record per line makes grep so much more useful.
I would think you could default to one, and have a flag and/or environment variable to switch to the other mode. For that matter, perhaps the utilities should detect when stdout isn't a terminal (such as piping to another command) and automatically go into "machine" mode in that case.
Anyways, just a thought - if nobody else who's actually familiar with the code jumps on the idea I might try patch it in myself. |
|
Back to top |
|
|
delta407 Bodhisattva
Joined: 23 Apr 2002 Posts: 2876 Location: Chicago, IL
|
Posted: Mon Jul 08, 2002 9:23 pm Post subject: |
|
|
emerge --help | less -r
1. Or better yet, get a TERMINFO structure and see if the destination will take ANSI codes.
2. Would you rather have a prompt? Besides, you can change the count; look at /etc/make.globals
3. Err... what? _________________ I don't believe in witty sigs. |
|
Back to top |
|
|
klieber Bodhisattva
Joined: 17 Apr 2002 Posts: 3657 Location: San Francisco, CA
|
Posted: Mon Jul 08, 2002 9:27 pm Post subject: Re: emerge options |
|
|
Some comments:
ph317 wrote: | For example, it's really frustrating to "emerge -s blah | less" to page it out and get a screenfull of ANSI codes making it impossible to read. |
Try: Code: | emerge -s blah |less -R |
ph317 wrote: | 2) Never do things like the 5 second countdown timer of unmerge/clean |
You can set this in /etc/make.globals -- look for the CLEAN_DELAY option.
ph317 wrote: | Anyways, just a thought - if nobody else who's actually familiar with the code jumps on the idea I might try patch it in myself. |
Sounds like a great idea -- I know other folks (including myself) have had issues with the ANSI color codes, specifically. drobbins owns the portage system, so he's the man to talk to about changes/improvements/additions. I'd certainly welcome the changes you propose.
--kurt _________________ The problem with political jokes is that they get elected |
|
Back to top |
|
|
ph317 n00b
Joined: 02 Jun 2002 Posts: 43
|
Posted: Wed Jul 10, 2002 3:08 pm Post subject: |
|
|
delta407 wrote: | emerge --help | less -r
1. Or better yet, get a TERMINFO structure and see if the destination will take ANSI codes.
2. Would you rather have a prompt? Besides, you can change the count; look at /etc/make.globals
3. Err... what? |
Yes there's ways around it - but to answer those and your apprehension about 3 - to me it's a matter of being in the unix spirit of things. Unix commandline tools share a certain design philosophy that makes them integrate well with each other, and emerge goes against the grain of that.
I expect to be able to grep a program's output for useful things, and not get single lines out of multiline entries that are meaningless out of context(or have grep confused into not finding a string because there was an embedded escape sequence in the output). |
|
Back to top |
|
|
delta407 Bodhisattva
Joined: 23 Apr 2002 Posts: 2876 Location: Chicago, IL
|
Posted: Wed Jul 10, 2002 5:00 pm Post subject: |
|
|
How would you suggest to make the fetch process, the unpack process, the output of ./configure, the output of make, and the installation procedure all fit into an easily-grepable output? _________________ I don't believe in witty sigs. |
|
Back to top |
|
|
hielvc Advocate
Joined: 19 Apr 2002 Posts: 2805 Location: Oceanside, Ca
|
Posted: Mon Jul 15, 2002 5:25 pm Post subject: |
|
|
Here is a patch file for emerge (portage 2.0.13). Dang It looks like the formate is srewed if I try to paste it in. If you want and/or know how I get post it let me know. Might be quicker to fire up Gvim and open up /usr/bin/emerge. Its fairly easy to figure out.
hielvc |
|
Back to top |
|
|
Nitro Bodhisattva
Joined: 08 Apr 2002 Posts: 661 Location: San Francisco
|
Posted: Mon Jul 15, 2002 5:52 pm Post subject: Re: emerge options |
|
|
Should have taken a peek at /etc/make.globals.
ph317 wrote: | 1) Get rid of ANSI color codes and the like |
Code: | NOCOLOR="true" emerge -u world -p | less |
ph317 wrote: | 2) Never do things like the 5 second countdown timer of unmerge/clean |
Code: | CLEAN_DELAY="0" emerge -c |
ph317 wrote: | 3) Only print concise, pertinent output, one record per line, in a format easy to work with for grep/sed/awk/perl/python/etc (whatever your choice of processing tool might be). One record per line makes grep so much more useful.
I would think you could default to one, and have a flag and/or environment variable to switch to the other mode. For that matter, perhaps the utilities should detect when stdout isn't a terminal (such as piping to another command) and automatically go into "machine" mode in that case.
Anyways, just a thought - if nobody else who's actually familiar with the code jumps on the idea I might try patch it in myself. |
What information do you want? Take a peek at qpkg and epm in the gentoolkit (emerge gentoolkit).
Or make your own tools, all the information about emerged packages is already stored (for the most part on one line) in /var/db/pkg. _________________ - Kyle Manna
Please, please SEARCH before posting.
There are three kinds of people in the world: those who can count, and those who can't. |
|
Back to top |
|
|
|