cookutils diff lighttpd/index.cgi @ rev 1076

lighttpd/index.cgi: show icon for all sub-packages (like *-dev, etc.); better handle "debug" query; fix display commits.log
author Aleksej Bobylev <al.bobylev@gmail.com>
date Tue Jun 12 01:38:59 2018 +0300 (2018-06-12)
parents 12ab43dfc0a9
children aa5729cf385c
line diff
     1.1 --- a/lighttpd/index.cgi	Mon Jun 11 15:24:16 2018 +0300
     1.2 +++ b/lighttpd/index.cgi	Tue Jun 12 01:38:59 2018 +0300
     1.3 @@ -15,6 +15,13 @@
     1.4  
     1.5  . /usr/lib/slitaz/httphelper.sh
     1.6  
     1.7 +case $QUERY_STRING in
     1.8 +	*debug*)
     1.9 +		debug='yes'
    1.10 +		QUERY_STRING="$(echo "$QUERY_STRING" | sed 's|debug||; s|^&||; s|&&|\&|; s|&$||')"
    1.11 +		;;
    1.12 +esac
    1.13 +
    1.14  [ -f "/etc/slitaz/cook.conf" ] && . /etc/slitaz/cook.conf
    1.15  [ -f "./cook.conf" ] && . ./cook.conf
    1.16  wok="$WOK"
    1.17 @@ -161,7 +168,7 @@
    1.18  <main>
    1.19  EOT
    1.20  
    1.21 -	[ -n "$(GET debug)" ] && echo "<pre><code class='language-ini'>$(env | sort)</code></pre>"
    1.22 +	[ -n "$debug" ] && echo "<pre><code class='language-ini'>$(env | sort)</code></pre>"
    1.23  }
    1.24  
    1.25  
    1.26 @@ -709,8 +716,8 @@
    1.27  	log="$LOGS/$pkg.log"
    1.28  
    1.29  	echo -n "<div id=\"hdr\"><a href=\"$base/${requested_pkg:-$pkg}\">"
    1.30 -	if [ -e $wok/${requested_pkg:-$pkg}/.icon.png ]; then
    1.31 -		echo -n "<img src=\"$base/${requested_pkg:-$pkg}/browse/.icon.png\"/>"
    1.32 +	if [ -e $wok/$pkg/.icon.png ]; then
    1.33 +		echo -n "<img src=\"$base/$pkg/browse/.icon.png\"/>"
    1.34  	else
    1.35  		echo -n "<img src=\"/tazpkg.png\"/>"
    1.36  	fi
    1.37 @@ -1015,8 +1022,9 @@
    1.38  if [ -z "$pkg" ]; then
    1.39  
    1.40  	page_header
    1.41 -	if [ -n "$QUERY_STRING" -a "$QUERY_STRING" != 'debug' ]; then
    1.42 +	if [ -n "$QUERY_STRING" ]; then
    1.43  
    1.44 +		[ "$QUERY_STRING" != 'commits.log' ] &&
    1.45  		for list in activity cooknotes cooklist commits; do
    1.46  			[ -n "$(GET $list)" ] || continue
    1.47  			case $list in