Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
emerge options
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Gentoo Chat
View previous topic :: View next topic  
Author Message
ph317
n00b
n00b


Joined: 02 Jun 2002
Posts: 43

PostPosted: Mon Jul 08, 2002 9:21 pm    Post subject: emerge options Reply with quote

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
View user's profile Send private message
delta407
Bodhisattva
Bodhisattva


Joined: 23 Apr 2002
Posts: 2876
Location: Chicago, IL

PostPosted: Mon Jul 08, 2002 9:23 pm    Post subject: Reply with quote

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
View user's profile Send private message
klieber
Bodhisattva
Bodhisattva


Joined: 17 Apr 2002
Posts: 3657
Location: San Francisco, CA

PostPosted: Mon Jul 08, 2002 9:27 pm    Post subject: Re: emerge options Reply with quote

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
View user's profile Send private message
ph317
n00b
n00b


Joined: 02 Jun 2002
Posts: 43

PostPosted: Wed Jul 10, 2002 3:08 pm    Post subject: Reply with quote

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
View user's profile Send private message
delta407
Bodhisattva
Bodhisattva


Joined: 23 Apr 2002
Posts: 2876
Location: Chicago, IL

PostPosted: Wed Jul 10, 2002 5:00 pm    Post subject: Reply with quote

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
View user's profile Send private message
hielvc
Advocate
Advocate


Joined: 19 Apr 2002
Posts: 2805
Location: Oceanside, Ca

PostPosted: Mon Jul 15, 2002 5:25 pm    Post subject: Reply with quote

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
View user's profile Send private message
Nitro
Bodhisattva
Bodhisattva


Joined: 08 Apr 2002
Posts: 661
Location: San Francisco

PostPosted: Mon Jul 15, 2002 5:52 pm    Post subject: Re: emerge options Reply with quote

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
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Gentoo Chat All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum