#!/bin/tcsh -f setenv DONE "done" setenv INFILE "x" setenv POPT "" set create=0 if ($1 == "help") then echo "" else foreach OPT ($*) if ($OPT == "verbose") setenv POPT $POPT"v" if ($OPT == "force") setenv POPT $POPT"f" if ($OPT == "fullupdate" && $create == 0) set create=1 if ($OPT == "oldupdate" && $create == 0) set create=2 end endif if ($create != 0) then if ($create == 1) then pkg_info | awk '{print $1}' > $INFILE else if ($create == 2) then portversion -v -l \< | awk '{print $1}' > $INFILE else echo "Create option unknown" exit 1 endif exit 0 endif if (! -e $DONE) touch $DONE setenv TOTAL `cat $INFILE | grep -vf $DONE | wc -l` set tot=$TOTAL set a=1 foreach X (`cat $INFILE | grep -vf $DONE`) echo "" echo "" echo "Updating port $X - $a of $tot" portupgrade -$POPT $X setenv ST $status echo "" echo "" if ($ST == 1) then echo "Press Enter when ready.." setenv Y $< else @ pr = ($a * 100) / $tot; echo "Port $X - $a of $tot - $pr% done." endif echo "" echo $X >> $DONE @ a++; end