ogajduse / rpms / texlive

Forked from rpms/texlive 6 years ago
Clone
4931932
diff -up texlive-2007/texk/tetex/texdoc.man.texdoc texlive-2007/texk/tetex/texdoc.man
39ed6db
--- texlive-2007/texk/tetex/texdoc.man.texdoc	2008-01-22 09:34:54.000000000 +0100
39ed6db
+++ texlive-2007/texk/tetex/texdoc.man	2008-01-22 09:37:03.000000000 +0100
39ed6db
@@ -28,28 +28,37 @@ distribution\&.
4931932
 .PP 
4931932
 .SH "OPTIONS" 
4931932
 .PP 
4931932
-.IP "\fB--help\fP" 
4931932
+.IP "\fB\-\-help\fP" 
4931932
 Display a brief summary of options\&.
4931932
 .IP 
4931932
-.IP "\fB-l\fP" 
4931932
+.IP "\fB\-l\fP" 
4931932
 List matching files\&.  Does not start a viewer\&.
4931932
-.IP "\fB-v\fP" 
4931932
+.PP
4931932
+.IP "\fB\-s\fP"
4931932
+Search the disk. From all documentation files found by texdoc, the
4931932
+ones whose names match the remaining arguments (as egrep pattern) will
4931932
+be displayed.
4931932
+.IP "\fB\-v\fP" 
4931932
 Sets verbose mode\&.  Shows the command being used to
4931932
 display the documentation\&.
4931932
 .PP 
39ed6db
 .SH "ENVIRONMENT" 
39ed6db
 .PP 
4931932
 .IP "\fB$TEXDOCVIEW_dvi\fP" 
39ed6db
-DVI viewer\&.  Defaults to \fBxdvi\fP(1)\&.
39ed6db
+DVI viewer\&. The default is to use the program specified
39ed6db
+by the freedesktop standard\&.
4931932
 .IP "\fB$TEXDOCVIEW_pdf\fP" 
4931932
-PDF viewer\&.  Defaults to \fBacroread\fP(1)\&.
4931932
+PDF viewer\&. The default is to use the program specified
4931932
+by the freedesktop standard\&.
4931932
 .IP "\fB$TEXDOCVIEW_ps\fP" 
4931932
-PostScript viewer\&.  Defaults to
4931932
-\fBghostview\fP(1)\&.
4931932
+PostScript viewer\&. The default is to use the program specified
4931932
+by the freedesktop standard\&.
4931932
 .IP "\fB$TEXDOCVIEW_html\fP" 
4931932
-HTML viewer\&.  Defaults to \fBnetscape\fP(1)\&.
4931932
+HTML viewer\&. The default is to use a program through
4931932
+\fBxdg-open\fP\&.
4931932
 .IP "\fB$TEXDOCVIEW_txt\fP" 
4931932
-Text viewer\&.  Defaults to \fB$PAGER-more\fP\&.
4931932
+Text viewer\&.  Defaults is to use the program specified
4931932
+by the freedesktop standard\&.
4931932
 .PP 
4931932
 The environment variables should be set with a ``%s\&'\&' as a placeholder
4931932
 for the name of the file\&.  For example,
39ed6db
@@ -66,10 +75,18 @@ hostname$ TEXDOCVIEW_html="mozilla %s"
4931932
 hostname$ export TEXDOCVIEW_html
4931932
 .EE 
4931932
 .PP 
4931932
+.SH "SPECIFIC TO DEBIAN AND FEDORA"
4931932
+.PP
4931932
+The Debian and Fedora TeX Live packages texdoc use the mime-support package to determine
4931932
+the appropriate viewer for the respective file type except for
4931932
+\fIdvi\fP. texdoc of Debian and Fedora is able to handle gzip- and
4931932
+bzip2-compressed files. If texdoc finds more than on file for a string
4931932
+the first hit is displayed. The file extensions are regarded and the
4931932
+search order can be configured in \fItexmf.cnf\fP (\fI90TeXDoc.cnf\fP).
4931932
+.PP 
4931932
 .SH "SEE ALSO" 
4931932
 .PP 
4931932
-\fBacroread\fP(1), \fBgv\fP(1), \fBkpsewhich\fP(1),
4931932
-\fBless\fP(1), \fBmore\fP(1), \fBxdvi\fP(1)
39ed6db
+\fBxdg-open\fP(1)
4931932
 .PP 
4931932
 Web page: <http://tug\&.org/teTeX/>
4931932
 .PP 
4931932
diff -up texlive-2007/texk/tetex/texdoc.texdoc texlive-2007/texk/tetex/texdoc
4931932
--- texlive-2007/texk/tetex/texdoc.texdoc	2006-01-17 22:41:51.000000000 +0100
39ed6db
+++ texlive-2007/texk/tetex/texdoc	2008-01-22 09:39:17.000000000 +0100
4931932
@@ -17,6 +17,15 @@
4931932
 #
4931932
 # Support for compressed documentation implemented by adopting changes
4931932
 # made by debian. Thomas Esser, Dec. 2004.
4931932
+#
4931932
+# Debian specific changes:
4931932
+#    Denis Barbier <barbier@imacs.polytechnique.fr>, Feb 15 2000
4931932
+#  * accept gzipped files on input
4931932
+#  * temporary directory set according to TMPDIR
4931932
+#    
4931932
+#    Frank Küster <frank@debian.org>, 2004-11-23
4931932
+#  * do not uncompress dvi.gz, xdvi can handle this
4931932
+#  * go to background with uncompressed files
4931932
 
4931932
 test -f /bin/sh5 && test -z "$RUNNING_SH5" \
4931932
   && { UNAMES=`uname -s`; test "x$UNAMES" = xULTRIX; } 2>/dev/null \
4931932
@@ -30,22 +39,22 @@ unset RUNNING_BSH
4931932
 
4931932
 export PATH
4931932
 
4931932
-needsCleanup=false
4931932
+# needsCleanup=false
4931932
 progname=texdoc
4931932
-tmpdir=${TMPDIR-${TEMP-${TMP-/tmp}}}/$progname.$$
4931932
+# tmpdir=${TMPDIR-${TEMP-${TMP-/tmp}}}/$progname.$$
4931932
 
4931932
 ###############################################################################
4931932
 # setupTmpDir()
4931932
 #   set up a temp directory and a trap to remove it
4931932
 ###############################################################################
4931932
-setupTmpDir()
4931932
-{
4931932
-  $needsCleanup && return
4931932
+# setupTmpDir()
4931932
+# {
4931932
+#   $needsCleanup && return
4931932
 
4931932
-  trap 'cleanup --force' 1 2 3 7 13 15
4931932
-  needsCleanup=true
4931932
-  mkdir "$tmpdir" || abort "could not create directory \`$tmpdir'"
4931932
-}
4931932
+#   trap 'cleanup --force' 1 2 3 7 13 15
4931932
+#   needsCleanup=true
4931932
+#   mkdir "$tmpdir" || abort "could not create directory \`$tmpdir'"
4931932
+# }
4931932
 
4931932
 ###############################################################################
4931932
 # abort(errmsg) 
4931932
@@ -65,15 +74,21 @@ abort()
4931932
 ###############################################################################
4931932
 cleanup()
4931932
 {
4931932
-  case $1 in
4931932
-    --force)
4931932
-        $needsCleanup && test -n "$tmpdir" && test -d "$tmpdir" \
4931932
-          && { rm -f "$tmpdir"/*; cd /; rmdir "$tmpdir"; }
4931932
-        ;;
4931932
-    *)  # directory might not be empty if some other viewer is still
4931932
-        # running, so be quiet about it
4931932
-        rmdir $tmpdir >/dev/null 2>&1;;
4931932
-  esac
4931932
+#   case $1 in
4931932
+#     --force)
4931932
+#         $needsCleanup && test -n "$tmpdir" && test -d "$tmpdir" \
4931932
+#           && { rm -f "$tmpdir"/*; cd /; rmdir "$tmpdir"; }
4931932
+#         ;;
4931932
+#     *)  # directory might not be empty if some other viewer is still
4931932
+#         # running, so be quiet about it
4931932
+#         rmdir $tmpdir >/dev/null 2>&1;;
4931932
+#   esac
4931932
+  # is the temporary directory empty? If not, texdoc was called with 
4931932
+  # two or more arguments, and one viewer is still running
4931932
+  if test "`echo $tmpdir/*`" = $tmpdir/'*'
4931932
+  then
4931932
+    rm -rf $tmpdir
4931932
+  fi
4931932
 }
4931932
 
4931932
 
39ed6db
@@ -91,13 +106,12 @@ case `(uname -s) 2>/dev/null` in
39ed6db
         extlist='.pdf .ps .txt .dvi .html'
4931932
 	;;
4931932
   *)
39ed6db
-	: ${TEXDOCVIEW_dvi='(xdvi %s) &'}
4931932
-	: ${TEXDOCVIEW_pdf='(acroread %s) &'}
4931932
-	: ${TEXDOCVIEW_ps='(gv %s) &'}
4931932
-	: ${TEXDOCVIEW_html='mozilla -remote openURL'"'(%s)'"' 2>/dev/null || mozilla %s &'}
4931932
-	: ${TEXDOCVIEW_txt="${PAGER-more} %s"}
4931932
-	: ${TEXDOCVIEW_="${PAGER-more} %s"} # no extension, default to pager
4931932
-        extlist='.dvi .dvi.gz .dvi.bz2 .pdf .pdf.gz .pdf.bz2 .ps .ps.gz .ps.bz2 .txt .txt.gz .txt.bz2 .html'
39ed6db
+	: ${TEXDOCVIEW_dvi='(xdg-open %s) &'}
4931932
+	: ${TEXDOCVIEW_pdf='(xdg-open %s) &'}
4931932
+	: ${TEXDOCVIEW_ps='(xdg-open %s) &'}
4931932
+	: ${TEXDOCVIEW_html='(xdg-open %s) &'}
4931932
+	: ${TEXDOCVIEW_txt='(xdg-open %s) &'}
4931932
+	: ${TEXDOCVIEW_='(xdg-open %s) &'}
4931932
 
4931932
         # Commands run to uncompress files, according to filename extension.
4931932
         : ${TEXDOCUNZIP_gz='gzip -d -c'}
4931932
@@ -105,6 +119,10 @@ case `(uname -s) 2>/dev/null` in
4931932
 	;;
4931932
 esac
4931932
 
4931932
+extlist=`kpsewhich --expand-brace='$TEXDOCEXT' | tr ':' ' '`
4931932
+test -z "$extlist" && \
4931932
+extlist='.dvi .dvi.gz .dvi.bz2 .pdf .pdf.gz .pdf.bz2 .ps .ps.gz .ps.bz2 .txt .txt.gz .txt.bz2 .html'
4931932
+
4931932
 mode=viewer
4931932
 help='Usage: texdoc [OPTION]... [NAME]...
4931932
   Search for NAME in the TeX documentation and start a viewer.
4931932
@@ -136,11 +154,14 @@ case $# in
4931932
     ;;
4931932
 esac
4931932
 
4931932
+tmpdir=`mktemp -d -t texdoc.XXXXXXXX`
4931932
+trap 'rc=$?; cleanup; exit $rc' 1 2 6 13 15
4931932
+
4931932
 for name
4931932
 do
4931932
   case $mode in
4931932
     search)
4931932
-      find `kpsewhich --expand-path='$TEXMF/doc' | tr : ' '` -type f -print |
4931932
+      find `kpsewhich --expand-path='$TEXDOCS' | tr : ' '` -follow -type f -print |
4931932
         egrep $name
4931932
       continue
4931932
       ;;
4931932
@@ -153,7 +174,6 @@ do
4931932
 
4931932
   found=false
4931932
   for ext in "" $extlist; do
4931932
-
4931932
     filename=`kpsewhich -format='TeX system documentation' $name$ext 2>/dev/null`
4931932
     test -z "$filename" && continue
4931932
     found=true
4931932
@@ -177,7 +197,6 @@ do
4931932
         # than once
4931932
         test -f "$tmpdir/$src" && break
4931932
 
4931932
-        setupTmpDir
4931932
         eval "$uncompress $filename > $tmpdir/$src"
4931932
         filename=$tmpdir/$src
4931932
         viewer=`eval echo $viewer | sed -e "s|%s|$filename; rm -f $filename; cleanup|"`