wok diff tazpkg-web/stuff/search.cgi @ rev 4359
Up dnsmasq (2.50)
author | Pascal Bellard <pascal.bellard@slitaz.org> |
---|---|
date | Mon Oct 05 15:56:28 2009 +0200 (2009-10-05) |
parents | dbf2180c7325 |
children | 85313fe45f02 |
line diff
1.1 --- a/tazpkg-web/stuff/search.cgi Tue Jun 23 08:56:37 2009 +0200 1.2 +++ b/tazpkg-web/stuff/search.cgi Mon Oct 05 15:56:28 2009 +0200 1.3 @@ -270,9 +270,9 @@ 1.4 _EOT_ 1.5 } 1.6 1.7 -# recursive dependencies scan 1.8 -dep_scan() 1.9 -{ 1.10 +# recursive dependencies scan 1.11 +dep_scan() 1.12 +{ 1.13 for i in $1; do 1.14 case " $ALL_DEPS " in 1.15 *\ $i\ *) continue;; 1.16 @@ -294,9 +294,9 @@ 1.17 done 1.18 } 1.19 1.20 -# recursive reverse dependencies scan 1.21 -rdep_scan() 1.22 -{ 1.23 +# recursive reverse dependencies scan 1.24 +rdep_scan() 1.25 +{ 1.26 SEARCH=$1 1.27 case "$SEARCH" in 1.28 glibc-base|gcc-lib-base) cat <<EOT 1.29 @@ -349,6 +349,12 @@ 1.30 return 1 1.31 } 1.32 1.33 +# Display < > & 1.34 +htmlize() 1.35 +{ 1.36 + sed -e 's/&/\&/g' -e 's/</\</g' -e 's/>/\>/g' 1.37 +} 1.38 + 1.39 # Display search form and result if requested. 1.40 if [ "$REQUEST_METHOD" != "POST" ]; then 1.41 xhtml_header 1.42 @@ -449,19 +455,30 @@ 1.43 unlzma -c $PACKAGES_REPOSITORY/files.list.lzma \ 1.44 | grep ^$SEARCH: | sed 's/.*: / /' | sort 1.45 elif [ "$OBJECT" = "Desc" ]; then 1.46 - cat << _EOT_ 1.47 + if [ -f $WOK/$SEARCH/description.txt ]; then 1.48 + cat << _EOT_ 1.49 + 1.50 +<h3>$result</h3> 1.51 +<pre class="package"> 1.52 +<pre> 1.53 +$(htmlize < $WOK/$SEARCH/description.txt) 1.54 +</pre> 1.55 +_EOT_ 1.56 + else 1.57 + cat << _EOT_ 1.58 1.59 <h3>$result</h3> 1.60 <pre class="package"> 1.61 _EOT_ 1.62 - last="" 1.63 - grep -i $SEARCH $PACKAGES_REPOSITORY/packages.desc | \ 1.64 - sort | while read pkg extras ; do 1.65 + last="" 1.66 + grep -i $SEARCH $PACKAGES_REPOSITORY/packages.desc | \ 1.67 + sort | while read pkg extras ; do 1.68 . $WOK/$pkg/receipt 1.69 cat << _EOT_ 1.70 <a href="$SLITAZ_VERSION/$CATEGORY.html#$PACKAGE">$PACKAGE</a> : $SHORT_DESC 1.71 _EOT_ 1.72 done 1.73 + fi 1.74 elif [ "$OBJECT" = "Tags" ]; then 1.75 cat << _EOT_ 1.76 1.77 @@ -485,8 +502,8 @@ 1.78 $(if [ -f $WOK/$SEARCH/taz/*/receipt ]; then 1.79 cat $WOK/$SEARCH/taz/*/receipt 1.80 else 1.81 - cat $WOK/$SEARCH//receipt 1.82 - fi | sed -e 's/&/\&/g' -e 's/</\</g' -e 's/>/\>/g') 1.83 + cat $WOK/$SEARCH/receipt 1.84 + fi | htmlize) 1.85 </pre> 1.86 _EOT_ 1.87 else 1.88 @@ -498,8 +515,10 @@ 1.89 for pkg in `ls $WOK | grep $SEARCH` 1.90 do 1.91 . $WOK/$pkg/receipt 1.92 + DESC=" <a href=\"?desc=$pkg\">description</a>" 1.93 + [ -f $WOK/$pkg/description.txt ] || DESC="" 1.94 cat << _EOT_ 1.95 -<a href="$SLITAZ_VERSION/$CATEGORY.html#$PACKAGE">$PACKAGE</a> : $SHORT_DESC 1.96 +<a href="$SLITAZ_VERSION/$CATEGORY.html#$PACKAGE">$PACKAGE</a> : $SHORT_DESC$DESC 1.97 _EOT_ 1.98 done 1.99 equiv=$PACKAGES_REPOSITORY/packages.equiv