slitaz-forge diff pkgs/mirror-search.sh @ rev 360

mirror-search.sh: unlinearize tag cloud
author Pascal Bellard <pascal.bellard@slitaz.org>
date Sat Apr 06 13:12:32 2013 +0200 (2013-04-06)
parents 5f0604259322
children 22d996164de0
line diff
     1.1 --- a/pkgs/mirror-search.sh	Sun Nov 04 21:23:50 2012 +0100
     1.2 +++ b/pkgs/mirror-search.sh	Sat Apr 06 13:12:32 2013 +0200
     1.3 @@ -11,6 +11,9 @@
     1.4  # Parse query string
     1.5  . /usr/lib/slitaz/httphelper.sh
     1.6  
     1.7 +case "$HTTP_USER_AGENT" in
     1.8 +*/[Bb]ot*|*[Bb]ot/*|*spider/*) exec $PWD/Travaux.sh ;;
     1.9 +esac
    1.10  
    1.11  # User preferred language
    1.12  # parameter $1 have priority; without parameter $1 - browser language only
    1.13 @@ -278,9 +281,12 @@
    1.14  	PACKAGE_URL="http://mirror.slitaz.org/packages/$SLITAZ_VERSION/$(cd /var/www/slitaz/mirror/packages/$SLITAZ_VERSION ; ls $PACKAGE-$VERSION*.tazpkg)"
    1.15  	busybox wget -s $PACKAGE_URL 2> /dev/null &&
    1.16  	PACKAGE_HREF="<a href=\"$PACKAGE_URL\">$PACKAGE</a>"
    1.17 +	COOKER=""
    1.18 +	[ "$SLITAZ_VERSION" == "cooking" ] &&
    1.19 +	COOKER="<a href=\"http://cook.slitaz.org/cooker.cgi?pkg=$PACKAGE\">$(gettext "Cooker")</a>"
    1.20  	cat << _EOT_
    1.21  $PACKAGE_HREF $(installed_size $PACKAGE): $SHORT_DESC \
    1.22 -<a href="?receipt=$PACKAGE&amp;version=$SLITAZ_VERSION">$(gettext "Receipt")</a>
    1.23 +<a href="?receipt=$PACKAGE&amp;version=$SLITAZ_VERSION">$(gettext "Receipt")</a> $COOKER
    1.24  _EOT_
    1.25  fi
    1.26  	[ -n "$(GET debug)" ] && cat << _EOT_
    1.27 @@ -530,6 +536,8 @@
    1.28  {
    1.29  	echo "<p>"
    1.30  	while read cnt pct item ; do
    1.31 +		pct=$(((10000 - ((100 - $pct)**2))/100))
    1.32 +		pct=$(((10000 - ((100 - $pct)**2))/100))
    1.33  		cat <<EOT
    1.34  <span style="color:#99f; font-size:9pt; padding-left:5px; padding-right:2px;">\
    1.35  $cnt</span><a href="?$1=$item&amp;version=$SLITAZ_VERSION" style="\