cookutils rev 245
cooker: add Pascal patch to cgi web so it display better pct and TZ
author | Christophe Lincoln <pankso@slitaz.org> |
---|---|
date | Sat May 28 15:00:17 2011 +0200 (2011-05-28) |
parents | e35efad312d1 |
children | 6b819745d7da |
files | web/cooker.cgi |
line diff
1.1 --- a/web/cooker.cgi Sat May 28 00:41:01 2011 +0200 1.2 +++ b/web/cooker.cgi Sat May 28 15:00:17 2011 +0200 1.3 @@ -189,10 +189,8 @@ 1.4 inwok=$(ls $WOK | wc -l) 1.5 cooked=$(ls $PKGS/*.tazpkg | wc -l) 1.6 unbuilt=$(($inwok - $cooked)) 1.7 - [ "$cooked" -gt 0 ] && div=$(($inwok / 100)) 1.8 - [ "$div" -gt 0 ] && pct=$(($cooked / $div)) 1.9 - [ "$div" == 0 ] && pct=0 1.10 - [ "$div" == "" ] && pct=0 1.11 + pct=0 1.12 + [ $inwok -gt 0 ] && pct=$(( ($cooked * 100) / $inwok )) 1.13 cat << EOT 1.14 <div style="float: right;"> 1.15 <form method="get" action="$SCRIPT_NAME"> 1.16 @@ -213,7 +211,7 @@ 1.17 </pre> 1.18 1.19 <p> 1.20 - Packages: $inwok in the wok - $cooked cooked - $unbuilt unbuilt 1.21 + $(date '+%Y-%M-%d %H:%M') Packages: $inwok in the wok - $cooked cooked - $unbuilt unbuilt 1.22 </p> 1.23 <div class="pctbar"> 1.24 <div class="pct" style="width: ${pct}%;">${pct}%</div>