Sebastian Rahtz <[EMAIL PROTECTED]> wrote:
> strikes me, like Thomas, that Debian chose to break the teTeX
> distribution, and they should be the ones to work on it. I agree it
> would be nice if .dvi.gz files were located but in the cosmic list of
> priorities.....
Thanks to Denis Barbier <[EMAIL PROTECTED]>, and some
additional hacking of mine, here are patches to texdoc and xdvi to make them
recognize bz2 and gz compressed files:
--- texdoc Tue Feb 8 16:31:17 2000
+++ /usr/bin/texdoc Tue Feb 8 16:46:57 2000
@@ -55,31 +55,34 @@
for name
do
found=false
- for ext in "" .dvi .pdf .ps .txt .html; do
-
- filename=`kpsewhich -format='TeX system documentation' $name$ext 2>/dev/null`
- test -z "$filename" && continue
- found=true
-
- if test $mode = list; then
- echo $filename
- else
- ext=`echo $filename | sed 's%.*\.%%'`
- viewer=\$"TEXDOCVIEW_$ext"
- viewer=`eval echo $viewer | sed -e "s|%s|$filename|g"`
- if test -z "$viewer"
- then
- echo "Don't know how to view file type $ext" 1>&2
- echo "(matching file was $filename)" 1>&2
- else
- $verbosemode && echo $viewer
- dir=`echo "$filename" | sed 's%/[^/]*$%%'`
- test -n "$dir" && test -d "$dir" && cd "$dir"
- eval $viewer
- break # just stop after the first usable extension
+ displayed=false
+ for compext in .bz2 .gz ""; do
+ $displayed && break
+ for ext in "" .dvi .pdf .ps .txt .html; do
+ filename=`kpsewhich -format='TeX system documentation' $name$ext$compext 2>/dev/null`
+ test -z "$filename" && continue
+ found=true
+
+ if test $mode = list; then
+ echo $filename
+ else
+ ext=`echo $filename | sed -e 's%\.gz$%%' -e 's%\.bz2$%%' | sed 's%.*\.%%'`
+ viewer=\$"TEXDOCVIEW_$ext"
+ viewer=`eval echo $viewer | sed -e "s|%s|$filename|g"`
+ if test -z "$viewer"
+ then
+ echo "Don't know how to view file type $ext" 1>&2
+ echo "(matching file was $filename)" 1>&2
+ else
+ $verbosemode && echo $viewer
+ dir=`echo "$filename" | sed 's%/[^/]*$%%'`
+ test -n "$dir" && test -d "$dir" && cd "$dir"
+ eval $viewer
+ displayed=true
+ break # just stop after the first usable extension
+ fi
fi
- fi
-
+ done
done
$found || echo "Can't find documentation for \`$name'" 1>&2
done
--- xdvi Tue Feb 8 17:08:00 2000
+++ /usr/X11R6/bin/xdvi Tue Feb 8 17:08:18 2000
@@ -45,4 +45,23 @@
XFILESEARCHPATH="$xdviapppath:${XFILESEARCHPATH-%D}"; export XFILESEARCHPATH
fi
-exec xdvi.bin $NAMEOPT ${1+"$@"}
+filename=${1+"$@"}
+compress=0
+tempfile=`tempfile -p tetex -s .dvi`
+case "${filename}X" in
+ *.gzX)
+ gzip -d -c $filename > $tempfile
+ compress=1
+ ;;
+ *.bz2X)
+ bzip2 -d -c $filename > $tempfile
+ compress=1
+ ;;
+esac
+if test $compress = 1; then
+ trap "rm -f $tempfile" 0 1 2 15
+ filename=$tempfile
+fi
+
+xdvi.bin $NAMEOPT $filename || exit 1
+exit 0
--
/ / _ _ Didier Verna http://www.inf.enst.fr/~verna/
- / / - / / /_/ / EPITA / LRDE mailto:[EMAIL PROTECTED]
/_/ / /_/ / /__ / 14-16 rue Voltaire Tel. +33 (1) 44 08 01 77
94276 Kremlin-Bic�tre cedex Fax. +33 (1) 44 08 01 99