# HG changeset patch # User Aleksej Bobylev # Date 1496022530 -10800 # Node ID f439bf689ac8b4b58ea3bd39720ceb36be2e6607 # Parent ae08a645896527072f4a3c5a259966c6969cd712 cook: support per-package CONFIG_FILES, fix pre_install etc. extracting; lighttpd/index.cgi: display all descriptions. diff -r ae08a6458965 -r f439bf689ac8 cook --- a/cook Mon May 29 01:54:22 2017 +0300 +++ b/cook Mon May 29 04:48:50 2017 +0300 @@ -859,6 +859,7 @@ [ -n "$TAGS" ] && echo "TAGS=\"$TAGS\"" [ -n "$DEPENDS" ] && echo "DEPENDS=\"$DEPENDS\"" | tr -ds '\t' ' ' [ -n "$PROVIDE" ] && echo "PROVIDE=\"$PROVIDE\"" + [ -n "$CONFIG_FILES" ] && echo "CONFIG_FILES=\"$CONFIG_FILES\"" # Extract {pre,post}_{install,remove} functions; # post_install_gtk_() will be copied as post_install() for gtk+ package @@ -869,7 +870,7 @@ for j in install remove; do if grep -q "^${i}_${j}_$rname()" "$orig_receipt"; then echo - sed "/^${i}_${j}_$rname()/,/}/!d" "$orig_receipt" | \ + sed "/^${i}_${j}_$rname()/,/^}/!d" "$orig_receipt" | \ sed "s|^${i}_${j}_$rname()|${i}_${j}()|" fi done @@ -1030,7 +1031,7 @@ :; status # Find and remove old package(s) tempd="$(mktemp -d)"; cd "$tempd" - for testpkg in $(ls $PKGS/$PACKAGE-*.tazpkg 2> /dev/null); do + for testpkg in $(ls $PKGS/$PACKAGE-*.tazpkg 2>/dev/null); do # Extract receipt from each matched package cpio -F "$testpkg" -i receipt >/dev/null 2>&1 name=$(. receipt; echo $PACKAGE) @@ -1055,7 +1056,7 @@ set_paths if head -n1 "$pkgdir/receipt" | fgrep -q 'v2'; then for i in $PACKAGE $SPLIT; do - unset DEPENDS CAT + unset DEPENDS CAT CONFIG_FILES packit $i done else diff -r ae08a6458965 -r f439bf689ac8 lighttpd/index.cgi --- a/lighttpd/index.cgi Mon May 29 01:54:22 2017 +0300 +++ b/lighttpd/index.cgi Mon May 29 04:48:50 2017 +0300 @@ -638,7 +638,7 @@ if [ -f "$wok/$pkg/taz/$PACKAGE-$VERSION/receipt" ]; then echo "files" - [ -f "$wok/$pkg/description.txt" ] && + [ -n "$(ls $wok/$pkg/description*.txt)" ] && echo "description" unset EXTRAVERSION @@ -691,6 +691,17 @@ } +show_desc() { + echo "

Description of “$1”

" + if [ -n "$md2html" ]; then + $md2html $2 + else + show_code markdown < $2 + fi + echo "
" +} + + # @@ -1051,14 +1062,17 @@ description) page_header pkg_info - desc="$WOK$REQUEST_URI.txt" - if [ -s "$desc" ]; then + descs="$(ls $WOK/$pkg/description*.txt)" + if [ -n "$descs" ]; then echo '
' - if [ -n "$md2html" ]; then - $md2html $desc - else - show_code markdown < $desc - fi + [ -f "$WOK/$pkg/description.txt" ] && show_desc "$pkg" "$WOK/$pkg/description.txt" + for i in $descs; do + case $i in + */description.txt) continue ;; + *) package=$(echo $i | cut -d. -f2) ;; + esac + show_desc "$package" "$i" + done echo '
' else show_note w "No description of $pkg"