Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Watch what emerge -j is doing
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Documentation, Tips & Tricks
View previous topic :: View next topic  
Author Message
Circuitsoft
Tux's lil' helper
Tux's lil' helper


Joined: 14 Jul 2004
Posts: 112

PostPosted: Thu Feb 16, 2012 11:51 am    Post subject: Watch what emerge -j is doing Reply with quote

I like to watch portage from time to time, and wish emerge -j<number> had more detailed output. The following script, in another terminal, gives me just that.

Code:
#!/bin/bash
cd /vat/tmp/portage
trap 'kill $(pgrep -P $LOGVIEW) $LOGVIEW;exit' SIGINT

while true
do
        CURRENT_LOG=$(ls -dut */* | head -1 | sed 's/^.*\t//')/temp/build.log
        # Set xterm title
        echo -ne "\033]0;$CURRENT_LOG\007"
        (for try in $(seq 10)
        do
                tail -f $CURRENT_LOG
                sleep 1
        done) & LOGVIEW="$!"
        while [[ "$CURRENT_LOG" = "$(du -sk */* | sort -n | tail -1 | sed 's/^.*\t//')/temp/build.log" ]]
        do
                sleep 1
        done
        kill $(pgrep -P $LOGVIEW) $LOGVIEW
done
Back to top
View user's profile Send private message
Juippisi
Developer
Developer


Joined: 30 Sep 2005
Posts: 722
Location: /home

PostPosted: Wed Feb 29, 2012 10:02 pm    Post subject: Reply with quote

Hehe indeed it's very relaxing. Cheers for this one, went immediately into use.

Just one thing: In your script, it says cd /vat/tmp/portage
Back to top
View user's profile Send private message
kofrad
n00b
n00b


Joined: 26 Oct 2004
Posts: 38
Location: South Florida

PostPosted: Sat Mar 03, 2012 10:40 pm    Post subject: Reply with quote

Glad to see this script. I had almost considered disabling multiple jobs on my system just so I could watch emerge progress.. On the other hand I like the cleanliness out the output when it is enabled. :P

The script seems to work well, but I'm getting a constant error as it runs.

Code:

/usr/local/bin/watch_emerge: line 16: 22743 Terminated              ( for try in $(seq 10);
do
    tail -f $CURRENT_LOG; sleep 1;
done )


That seems to come up every 10 or so lines and results in a constant barrage of output from emerge repeating itself as new lines are printed.
Back to top
View user's profile Send private message
Juippisi
Developer
Developer


Joined: 30 Sep 2005
Posts: 722
Location: /home

PostPosted: Sat Mar 31, 2012 11:15 am    Post subject: Reply with quote

Although, --quiet-build n should work now.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Documentation, Tips & Tricks 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