No, it is not accurate. It's supposed to be a rough indication, and on most projects will be accurate within +-10%.markfl wrote:this isnt exactly accurate though... openoffice-ximian is on 129%
Its gotta be nearly done though, its been going for 7 hours ish
Mark
Code: Select all
ind: /var/tmp/portage/gst-plugins-oss-0.8.5/temp: Permission denied
find: /var/tmp/portage/rsync-2.6.3/temp: Permission denied
find: /var/tmp/portage/id3lib-3.8.3-r3/temp: Permission denied
find: /var/tmp/portage/ggv-2.8.0/temp: Permission denied
find: /var/tmp/portage/ggv-2.8.1/temp: Permission denied
find: /var/tmp/portage/HTML-Tagset-3.03-r2/temp: Permission denied
Code: Select all
#!/bin/sh
FULL=`tail -n 2 /var/log/emerge.log | grep Compiling | sed "s/\(.*\)Compiling\/Packaging \(.*\)::.*/\2/" | sed \
"s/(\([a-zA-Z].*\)\/\(.*\)/\1\/\2/"`
CUR=`echo $FULL | sed "s/\(.*\)\/\(.*\)/\2/"`
TOT=`find /var/tmp/portage/$CUR -iname "*.c*" | wc -l`
PROG=`find /var/tmp/portage/$CUR -iname "*.o*" | wc -l`
PRE_PER=`echo $PROG $TOT | gawk '{ sum += $1 / $2 }; END { print sum }' -`
PER=`echo $PRE_PER | gawk '{ sum += $1 * 100 }; END { print sum }' -`
echo "Currently Compiling Package: " $FULL " ("$PER"%)" Code: Select all
#!/bin/sh
FULL=`tail -n 2 /var/log/emerge.log | grep Compiling | sed "s/\(.*\)Compiling\/Merging \(.*\)::.*/\2/" | sed \
"s/(\([a-zA-Z].*\)\/\(.*\)/\1\/\2/"`
CUR=`echo $FULL | sed "s/\(.*\)\/\(.*\)/\2/"`
TOT=`find /var/tmp/portage/$CUR -iname "*.c*" | wc -l`
PROG=`find /var/tmp/portage/$CUR -iname "*.o*" | wc -l`
PRE_PER=`echo $PROG $TOT | gawk '{ sum += $1 / $2 }; END { print sum }' -`
PER=`echo $PRE_PER | gawk '{ sum += $1 * 100 }; END { print sum }' -`
echo "Currently Compiling Package: " $FULL " ("$PER"%)"

It didnt die 1/10th of the way through, the build had finished and the progress had only reached 10%.iplayfast wrote:and if a script dies 1/2 way through (or 1/10th in your case) it will aways show up until you delete the directory. (/var/tmp/portage/directory)

Code: Select all
#!/bin/sh
while true; do
FULL=`tail -n 2 /var/log/emerge.log | grep Compiling | sed "s/\(.*\)Compiling\/Merging \(.*\)::.*/\2/" | sed "s/(\([a-zA-Z].*\)\/\(.*\)/\1\/\2/"`
CUR=`echo $FULL | sed "s/\(.*\)\/\(.*\)/\2/"`
TOT=`find /var/tmp/portage/$CUR -iname "*.c*" | wc -l`
PROG=`find /var/tmp/portage/$CUR -iname "*.o*" | wc -l`
PER=`echo \`bc -l <<< $PROG/$TOT*100\` / 1 | bc`
#echo "Currently Compiling Package: " $FULL " ("$PRE"%)"
#echo "$COLUMNS / 5" | bc
#echo "["
echo col:$COLUMNS `bc -l <<< "$COLUMNS-20"`
echo ful:"$FULL - $PER"
if ((${#PER} == 0)); then if ((${PER} > 100)); then PER="100"; fi; fi
if ((${#FULL} == 0)); then FULL="nothing"; fi
dialog --title "Currently emerging $FULL..." --gauge "" -1 -1 $PER < /dev/null
sleep 3
done
Code: Select all
/root/emerge_progress: line 4: s/(\([a-zA-Z].*\)\/\(.*\)/\1\/\2/: No such file or directory
Currently Compiling Package: (app-office/openoffice-ximian-1.3.8 (48.8445%)I added a bug as an enhancement suggestion, and it was eventually dropped, because the bug/suggestion list was too busy. (Like the guy can't click the sort button!)ssmaxss wrote:maybe someone would add ebuild with this tools to portage? Or provide ebuild for people to place into overlay. Cat and paste into file isn't the best method...
Great script! Except that it needs a GUIEkorn wrote:Not related to the last discussion, but I have written a Emerge-progress script in perl.. Can be found here..
Not perfect in any way.. but working..
Any comments and suggestions are welcome
It has a gui, you only have to download the .glade-file too.. It is explained in the perl-file...(Maybe I should have said so?)swimmer wrote:Great script! Except that it needs a GUIEkorn wrote:Not related to the last discussion, but I have written a Emerge-progress script in perl.. Can be found here..
Not perfect in any way.. but working..
Any comments and suggestions are welcomeIs there any chance that we get something with console output as well?
Greetz
swimmer
Oh sorry - I was not clear enough :-/Ekorn wrote:It has a gui, you only have to download the .glade-file too.. It is explained in the perl-file...(Maybe I should have said so?)
I'm not running gentoo atm, so there is no development going on :/