cookutils rev 985

lighttpd/index.cgi: show button to re-create pkgdb in the same way like to recook package.
author Aleksej Bobylev <al.bobylev@gmail.com>
date Sun Oct 22 19:12:01 2017 +0300 (2017-10-22)
parents b5c90a3bb215
children 3417c788230c
files lighttpd/index.cgi
line diff
     1.1 --- a/lighttpd/index.cgi	Sun Oct 22 18:54:11 2017 +0300
     1.2 +++ b/lighttpd/index.cgi	Sun Oct 22 19:12:01 2017 +0300
     1.3 @@ -848,6 +848,20 @@
     1.4  					echo '<pre class="log">'
     1.5  					syntax_highlighter log < $log
     1.6  					echo '</pre>'
     1.7 +					if [ "$log" == 'pkgdb.log' ]; then
     1.8 +						# Display button only for SliTaz web browser
     1.9 +						case "$HTTP_USER_AGENT" in
    1.10 +							*SliTaz*)
    1.11 +								if [ -f $CACHE/cooker-request -a -n "$HTTP_REFERER" ]; then
    1.12 +									if grep -qs '^pkgdb$' $CACHE/recook-packages; then
    1.13 +										show_note i "The package database has been requested for re-creation"
    1.14 +									else
    1.15 +										echo "<a class='button' href='$base/?recook=pkgdb'>Re-create the DB</a>"
    1.16 +									fi
    1.17 +								fi
    1.18 +								;;
    1.19 +						esac
    1.20 +					fi
    1.21  				else
    1.22  					show_note e "No log file: $log"
    1.23  				fi