View previous topic :: View next topic |
Author |
Message |
sebest Apprentice
Joined: 03 Jul 2002 Posts: 163 Location: Paris - France
|
Posted: Tue Aug 06, 2002 4:40 pm Post subject: Logging emerge output |
|
|
I think it would be really usefull to have a log of the output of "merge".
Because when i emerge --update world, i can't read the einfo because of output of the compilation of the next package.
something like /var/log/emerge/PACKAGE_NAME/{info,compil,error}
info contains einfo output
compil contains compilations output
error contains the standard input errors |
|
Back to top |
|
|
ZagiFlyer Tux's lil' helper
Joined: 19 Apr 2002 Posts: 93 Location: San Jose, CA
|
Posted: Tue Aug 06, 2002 9:06 pm Post subject: |
|
|
I would expect you can either 'emerge foo > foo.out' if you don't need to read the output in real-time. Or you can write to stdout and a file at the same time. I forget what the symbol is for that, it's in the bash man page. I'd look it up and tell you, but I'm at work on my Windows machine. _________________ "Beer is proof that God loves us and wants us to be happy"
--Ben Franklin |
|
Back to top |
|
|
n0n Guru
Joined: 13 Jun 2002 Posts: 355
|
Posted: Tue Aug 06, 2002 9:14 pm Post subject: |
|
|
(Most of the following assumes you're using bash, BTW)
Send output to a logfile:
Code: | emerge foo > foo.log |
Send output to a logfile but still see it:
Code: | emerge foo | tee foo.log |
Send all output (including any errors) to a logfile:
Code: | emerge foo >& foo.log |
Send all output (including any errors) to a logfile but still see it:
Code: | emerge foo 2>&1 | tee foo.log |
Send all output to one logfile and errors to another:
Code: | emerge foo >foo.log 2>foo-errors.log |
Send all output to a logfile and then watch the logfile as it grows (hit Ctrl-C to exit out of the "tail" command):
Code: | emerge foo >& foo.log &
tail -f foo.log |
Send all output to a logfile and then watch the logfile using a decent pager (when inside "less," hit capital "F" to "follow" the file as it grows, Ctrl-C to stop it from doing so):
Code: | emerge foo >& foo.log &
less foo.log |
|
|
Back to top |
|
|
ZagiFlyer Tux's lil' helper
Joined: 19 Apr 2002 Posts: 93 Location: San Jose, CA
|
Posted: Tue Aug 06, 2002 9:16 pm Post subject: |
|
|
Wow. Ask and Ye Shall Receive! _________________ "Beer is proof that God loves us and wants us to be happy"
--Ben Franklin |
|
Back to top |
|
|
sebest Apprentice
Joined: 03 Jul 2002 Posts: 163 Location: Paris - France
|
Posted: Tue Aug 06, 2002 10:06 pm Post subject: |
|
|
Thank you!
But i already know about all of this...
But it doesn't solve the problem of "einfo"
The usefull informations printed at the end of the emerge of a package.
example:
Code: |
postfix/postfix-1.1.11.20020613.ebuild: einfo "***************************************************************"
postfix/postfix-1.1.11.20020613.ebuild: einfo "* NOTE: If config file protection is enabled and you upgraded *"
postfix/postfix-1.1.11.20020613.ebuild: einfo "* from an earlier version of postfix you must update *"
postfix/postfix-1.1.11.20020613.ebuild: einfo "* /etc/postfix/master.cf to the latest version *"
postfix/postfix-1.1.11.20020613.ebuild: einfo "* (/etc/postfix/._cfg????_master.cf). Otherwise postfix *"
postfix/postfix-1.1.11.20020613.ebuild: einfo "* will not work correctly. *"
postfix/postfix-1.1.11.20020613.ebuild: einfo "***************************************************************"
postfix/postfix-1.1.11.20020613.ebuild: einfo "********************************************************"
postfix/postfix-1.1.11.20020613.ebuild: einfo "* First time installers: You must edit *"
postfix/postfix-1.1.11.20020613.ebuild: einfo "* /etc/mail/aliases to suit your needs and then run *"
postfix/postfix-1.1.11.20020613.ebuild: einfo "* /usr/bin/newaliases. Postfix will not work correctly *"
postfix/postfix-1.1.11.20020613.ebuild: einfo "* without it *"
postfix/postfix-1.1.11.20020613.ebuild: einfo "********************************************************"
|
Should i
emerge --update world >& emerge.log
and then parse all the file to find the 5-10 lines that are usefull[/code] |
|
Back to top |
|
|
Naan Yaar Bodhisattva
Joined: 27 Jun 2002 Posts: 1549
|
Posted: Tue Aug 06, 2002 10:18 pm Post subject: |
|
|
grep -i einfo emerge.log? |
|
Back to top |
|
|
puddpunk l33t
Joined: 20 Jul 2002 Posts: 681 Location: New Zealand
|
Posted: Wed Aug 07, 2002 6:14 am Post subject: . |
|
|
Most einfos are preceded by a certain colour star.
You could try something like this (I think, my bash is a little rusty )
Code: | emerge --update world | grep "(insert colourcode here)*" > emerge.log |
remeber to use "" or the asterix will be taken by grep as a wildcard.
The only problem you'll have is with ebuilders that only use one einfo command for many lines of text, such as the old winex ebuild:
From /usr/portage/app-emulation/winex/winex-20020511
Code: |
einfo "If you are installing winex for the first time,
copy /etc/winex/config (global configuration) to ~/.wine/config
and edit that for per-user configuration. Otherwise, winex will
not run.
Also, run \"/usr/winex/bin/regapi setValue < /etc/winex/winedefault.reg\"
to setup
per-user registry for using winex. More info in
/usr/share/doc/winex-${PV}."
|
but you could always crack open the ebuild and check it out. |
|
Back to top |
|
|
delta407 Bodhisattva
Joined: 23 Apr 2002 Posts: 2876 Location: Chicago, IL
|
Posted: Wed Aug 07, 2002 6:37 am Post subject: Re: . |
|
|
puddpunk wrote: | Code: | emerge --update world | grep "(insert colourcode here)*" > emerge.log |
|
Or better yet:
Code: | emerge [command] 2>&1 | tee emerge.log | egrep "(insert escape sequence) *" | less |
That logs everything in emerge.log and outputs the instructions -- one page at a time -- to the screen. (As well as, of course, saving them to the log so you can find them later.) _________________ I don't believe in witty sigs. |
|
Back to top |
|
|
sebest Apprentice
Joined: 03 Jul 2002 Posts: 163 Location: Paris - France
|
Posted: Wed Aug 07, 2002 10:49 am Post subject: |
|
|
Thank you all
In fact i didn't want to know how to keep the output of emerge.
I wanted to know if it would be usefull that emerge has an options (--output) to separate compile, from info, from errors.
i know that you can do everything with grep, sed, tee, awk, cut, tr and so on.
Code: |
emerge --update world | grep "(insert colourcode here)*" > emerge.log
|
This is ok, but how many people know this coulourcode???
Wouldn't be easier to do
Code: |
emerge --update world --log-info
|
And then do
Code: |
$less /var/log/emerge/info
############################
##### postfix informations ##########
***************************************************************"
* NOTE: If config file protection is enabled and you upgraded *"
* from an earlier version of postfix you must update *"
* /etc/postfix/master.cf to the latest version *"
* (/etc/postfix/._cfg????_master.cf). Otherwise postfix *"
* will not work correctly. *"
***************************************************************"
********************************************************"
* First time installers: You must edit *"
* /etc/mail/aliases to suit your needs and then run *"
* /usr/bin/newaliases. Postfix will not work correctly *"
* without it *"
********************************************************"
.
.
.
|
And if we have theses logs
emerge could go on emerging --update world even if a package fails to compile.
We just have to check in the log which package failed to compile and look what is wrong with that one |
|
Back to top |
|
|
blunted Tux's lil' helper
Joined: 21 Jun 2002 Posts: 89 Location: Winnipeg, MB
|
Posted: Wed Aug 21, 2002 10:10 pm Post subject: color code |
|
|
what would that color code be, or where could i find a list of the color codes? man grep? man bash? |
|
Back to top |
|
|
rac Bodhisattva
Joined: 30 May 2002 Posts: 6553 Location: Japanifornia
|
Posted: Wed Aug 21, 2002 10:16 pm Post subject: Re: color code |
|
|
blunted wrote: | where could i find a list of the color codes? man grep? man bash? |
Probably something more like "man xterm" - it's a VT100 terminal emulator thing. Here's one list; I'm sure there are others (some that may be more complete). _________________ For every higher wall, there is a taller ladder |
|
Back to top |
|
|
EPrime Tux's lil' helper
Joined: 10 Aug 2002 Posts: 80 Location: Denmark
|
Posted: Sun Aug 25, 2002 3:57 am Post subject: |
|
|
I'm in the need of a script to do the same as requested by sebest, and cooked up the following:
Code: | qpkg -I -nc -v | \
sed 's/\(.*\)\/\(.*\)\(-[0-9].*\)/\/usr\/portage\/\1\/\2\/\2\3.ebuild/p' | \
uniq | sort | \
xargs -i cat -n '{}' | \
grep 'ebuild ' |
It basically lists all packages and figures out the corresponding ebuild filename, then greps in those for the text in quotes. If you put it all on one line be sure to remove the trailing backslashes.
Since grep can't write both the filename and the matching text it's still somewhat useless, but if someone could give me hint on how to fix it I'll be happy to improve it's usefulness a bit |
|
Back to top |
|
|
Naan Yaar Bodhisattva
Joined: 27 Jun 2002 Posts: 1549
|
Posted: Sun Aug 25, 2002 4:05 am Post subject: |
|
|
grep -H will do it. You can probably modify your script to do:
Code: |
#!/bin/bash
qpkg -I -nc -v | \
sed 's/\(.*\)\/\(.*\)\(-[0-9].*\)/\/usr\/portage\/\1\/\2\/\2\3.ebuild/p' | \
sort -u | \
xargs grep -H 'ebuild'
|
|
|
Back to top |
|
|
EPrime Tux's lil' helper
Joined: 10 Aug 2002 Posts: 80 Location: Denmark
|
Posted: Sun Aug 25, 2002 4:24 am Post subject: |
|
|
Thanks, that was fast! Next step is to figure out how to determine what is relevant for output, but that's for some other day - I think I can manage with this one for now but will post any improvements I get around to. |
|
Back to top |
|
|
|