# HG changeset patch # User Pascal Bellard # Date 1334749505 -7200 # Node ID 512cece24f7cc1f1049d36d7445264b2c3fdd99b # Parent 7e69ae6e69a5e3323b300604f173e6a2bb721d0d cooker.cgi: add download link diff -r 7e69ae6e69a5 -r 512cece24f7c web/cooker.cgi --- a/web/cooker.cgi Mon Apr 16 11:26:06 2012 +0200 +++ b/web/cooker.cgi Wed Apr 18 13:45:05 2012 +0200 @@ -2,8 +2,6 @@ # # SliTaz Cooker CGI/web interface. # -echo "Content-Type: text/html" -echo "" [ -f "/etc/slitaz/cook.conf" ] && . /etc/slitaz/cook.conf [ -f "cook.conf" ] && . ./cook.conf @@ -25,9 +23,20 @@ # We're not logged and want time zone to display correct server date. export TZ=$(cat /etc/TZ) -# -# Functions -# +if [ "${QUERY_STRING%%=*}" == "download" ]; then + file=$PKGS/${QUERY_STRING#*=} + cat <home" echo "files" + if [ -f "$wok/$pkg/taz/$PACKAGE-$VERSION/receipt" ]; then + unset EXTRAVERSION + . $wok/$pkg/taz/$PACKAGE-$VERSION/receipt + if [ -f $PKGS/$PACKAGE-$VERSION$EXTRAVERSION.tazpkg ]; then + echo "download" + fi + fi else echo "No package named: $pkg" fi