[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

r10296 - /man-cgi/static-repository/bin/fetch-man-pages.sh

Author: jfs
Date: Wed Oct 30 01:56:11 2013
New Revision: 10296

URL: http://svn.debian.org/wsvn/?sc=1&rev=10296
Document BUGs/issues found while running the scripts in glinka


Modified: man-cgi/static-repository/bin/fetch-man-pages.sh
URL: http://svn.debian.org/wsvn/man-cgi/static-repository/bin/fetch-man-pages.sh?rev=10296&op=diff
--- man-cgi/static-repository/bin/fetch-man-pages.sh	(original)
+++ man-cgi/static-repository/bin/fetch-man-pages.sh	Wed Oct 30 01:56:11 2013
@@ -50,10 +50,13 @@
 src_pkg=`dpkg -I "$DEB" | egrep "^ Package: |^ Source: " | tail -n1 | sed "s/^.*: //"`
+# BUG: Cruft gets created in /tmp/, it would be better to use a location specific for the script (work directory)
 #printf "%s\n" "INFO: Extracting manpages from [$DEB]"
 TEMPDIR=`mktemp -d -t doc-XXXXXX`
 trap "rm -rf $TEMPDIR 2>/dev/null || true" EXIT HUP INT QUIT TERM
+# BUG: script uses dpkg-deb -x which extracts the full package, should try to use --fsys-tarfile instead 
+# (see Debian's extractor script)
 dpkg-deb -x "$DEB" "$TEMPDIR"
 for i in $man; do
 	#printf "%s\n" "INFO: Considering entry [$i]"
@@ -91,10 +94,15 @@
 			# Note: we send stderr to /dev/null due to the following error 
 			# "defined(%hash) is deprecated at /usr/lib/w3m/cgi-bin/w3mman2html.cgi line 223."
 			BODY=`/usr/lib/w3m/cgi-bin/w3mman2html.cgi "local=$manpage" 2>/dev/null | grep -A 1000000 "^<b>" | sed -e '/<\/body>/,+100 d' -e 's:^<b>\(.*\)</b>$:</pre><h4><b>\1</b></h4><pre>:g' -e 's:<a href="file\:///[^?]*?\([^(]*\)(\([^)]*\))">:<a href="../man\2/\1.\2.html">:g'`
+                        # BUG: The w3mman2html.cgi process gets stuck generating ja/man5/apt_preferences
+                        # (never returns). The script should put a limit to this call and kill the process 
+                        # if it does not return
 			TITLE=`printf "%s" "$BODY" | head -n2 | tail -n1 | sed "s/<[^>]\+>//g"`
 			BIN_PKG=`printf "%s" "$NAME_AND_VER" | sed s/_.*$//g`
+                        # FIXME: The use of includes might not be OK form some servers, 
+                        # as an option read the www file and include it 'as is' 
 			printf "%s\n" "<!--#include virtual='/above1.html' -->" > "$out"
 			printf "%s\n" "$TITLE" >> "$out"
 			printf "%s\n" "<!--#include virtual='/above2.html' -->" >> "$out"

Reply to: