cookutils rev 509

cooker.cgi: add stuff links
author Pascal Bellard <pascal.bellard@slitaz.org>
date Thu Jul 12 09:38:37 2012 +0200 (2012-07-12)
parents 114f1aa7ccab
children c3e5084142d5
files web/cooker.cgi
line diff
     1.1 --- a/web/cooker.cgi	Mon Jul 09 11:22:30 2012 +0200
     1.2 +++ b/web/cooker.cgi	Thu Jul 12 09:38:37 2012 +0200
     1.3 @@ -239,10 +239,20 @@
     1.4  					echo "<pre>No log file: $log</pre>"
     1.5  				fi ;;
     1.6  		esac ;;
     1.7 +	stuff=*)
     1.8 +		file=${QUERY_STRING#stuff=}
     1.9 +		echo "<h2>$file</h2>"
    1.10 +		echo '<pre>'
    1.11 +		cat $wok/$file
    1.12 +		echo '</pre>' ;;
    1.13  	receipt=*)
    1.14  		pkg=${QUERY_STRING#receipt=}
    1.15  		echo "<h2>Receipt for: $pkg</h2>"
    1.16  		if [ -f "$wok/$pkg/receipt" ]; then
    1.17 +			( cd $wok/$pkg ; find stuff -type f 2> /dev/null ) | \
    1.18 +			while read file ; do
    1.19 +				echo "<a href=\"?stuff=$pkg/$file\">$file</a>"
    1.20 +			done
    1.21  			echo '<pre>'
    1.22  			cat $wok/$pkg/receipt | syntax_highlighter receipt
    1.23  			echo '</pre>'