#!/bin/bash #eprogress v0.0.1, July 13, 2004 #When given a package name this scipt is will track the progress of an ebuild by counting the number of .c and .cpp files in the portage temp directory and comparing it to the number of .o files that have been compiled so far. #When run without arguements it's useful for locating previous failed or interrupted ebuilds so they can be attempted again or deleted manually to free space. cd /var/tmp/portage printf "%40s%8s%8s%8s%9s" "PACKAGE" "TOTAL" "LEFT" "DONE" "PERCENT"; echo for i in $1*; do A=`find $i/ -iname "*.c*" | wc -l` if test $A -eq 0; then continue; fi B=`find $i/ -iname "*.o*" | wc -l` C=$[$A-$B] D=`expr $B \* 100 / $A` if test $D -gt 100; then D="??"; fi printf "%40s%8s%8s%8s%7s" "$i" "$A" "$C" "$B" "$D"; echo done