cookutils diff lighttpd/index.cgi @ rev 908
cook: support per-package CONFIG_FILES, fix pre_install etc. extracting; lighttpd/index.cgi: display all descriptions.
author | Aleksej Bobylev <al.bobylev@gmail.com> |
---|---|
date | Mon May 29 04:48:50 2017 +0300 (2017-05-29) |
parents | c711ef2e51a9 |
children | e68dad1ffbff |
line diff
1.1 --- a/lighttpd/index.cgi Sat May 27 16:23:38 2017 +0300 1.2 +++ b/lighttpd/index.cgi Mon May 29 04:48:50 2017 +0300 1.3 @@ -638,7 +638,7 @@ 1.4 if [ -f "$wok/$pkg/taz/$PACKAGE-$VERSION/receipt" ]; then 1.5 echo "<a class='button icon files$(active files)' href='$base/$pkg/files'>files</a>" 1.6 1.7 - [ -f "$wok/$pkg/description.txt" ] && 1.8 + [ -n "$(ls $wok/$pkg/description*.txt)" ] && 1.9 echo "<a class='button icon desc$(active description)' href='$base/$pkg/description'>description</a>" 1.10 1.11 unset EXTRAVERSION 1.12 @@ -691,6 +691,17 @@ 1.13 } 1.14 1.15 1.16 +show_desc() { 1.17 + echo "<section><h3>Description of “$1”</h3>" 1.18 + if [ -n "$md2html" ]; then 1.19 + $md2html $2 1.20 + else 1.21 + show_code markdown < $2 1.22 + fi 1.23 + echo "</section>" 1.24 +} 1.25 + 1.26 + 1.27 1.28 1.29 # 1.30 @@ -1051,14 +1062,17 @@ 1.31 description) 1.32 page_header 1.33 pkg_info 1.34 - desc="$WOK$REQUEST_URI.txt" 1.35 - if [ -s "$desc" ]; then 1.36 + descs="$(ls $WOK/$pkg/description*.txt)" 1.37 + if [ -n "$descs" ]; then 1.38 echo '<div id="content2">' 1.39 - if [ -n "$md2html" ]; then 1.40 - $md2html $desc 1.41 - else 1.42 - show_code markdown < $desc 1.43 - fi 1.44 + [ -f "$WOK/$pkg/description.txt" ] && show_desc "$pkg" "$WOK/$pkg/description.txt" 1.45 + for i in $descs; do 1.46 + case $i in 1.47 + */description.txt) continue ;; 1.48 + *) package=$(echo $i | cut -d. -f2) ;; 1.49 + esac 1.50 + show_desc "$package" "$i" 1.51 + done 1.52 echo '</div>' 1.53 else 1.54 show_note w "No description of $pkg"