]> git.pld-linux.org Git - packages/texlive.git/blob - texlive-texdoc.patch
- functional subpackages under working...
[packages/texlive.git] / texlive-texdoc.patch
1 diff -up texlive-2007/texk/tetex/texdoc.man.texdoc texlive-2007/texk/tetex/texdoc.man
2 --- texlive-2007/texk/tetex/texdoc.man.texdoc   2008-01-22 09:34:54.000000000 +0100
3 +++ texlive-2007/texk/tetex/texdoc.man  2008-01-22 09:37:03.000000000 +0100
4 @@ -28,28 +28,37 @@ distribution\&.
5  .PP 
6  .SH "OPTIONS" 
7  .PP 
8 -.IP "\fB--help\fP" 
9 +.IP "\fB\-\-help\fP" 
10  Display a brief summary of options\&.
11  .IP 
12 -.IP "\fB-l\fP" 
13 +.IP "\fB\-l\fP" 
14  List matching files\&.  Does not start a viewer\&.
15 -.IP "\fB-v\fP" 
16 +.PP
17 +.IP "\fB\-s\fP"
18 +Search the disk. From all documentation files found by texdoc, the
19 +ones whose names match the remaining arguments (as egrep pattern) will
20 +be displayed.
21 +.IP "\fB\-v\fP" 
22  Sets verbose mode\&.  Shows the command being used to
23  display the documentation\&.
24  .PP 
25  .SH "ENVIRONMENT" 
26  .PP 
27  .IP "\fB$TEXDOCVIEW_dvi\fP" 
28 -DVI viewer\&.  Defaults to \fBxdvi\fP(1)\&.
29 +DVI viewer\&. The default is to use the program specified
30 +by the freedesktop standard\&.
31  .IP "\fB$TEXDOCVIEW_pdf\fP" 
32 -PDF viewer\&.  Defaults to \fBacroread\fP(1)\&.
33 +PDF viewer\&. The default is to use the program specified
34 +by the freedesktop standard\&.
35  .IP "\fB$TEXDOCVIEW_ps\fP" 
36 -PostScript viewer\&.  Defaults to
37 -\fBghostview\fP(1)\&.
38 +PostScript viewer\&. The default is to use the program specified
39 +by the freedesktop standard\&.
40  .IP "\fB$TEXDOCVIEW_html\fP" 
41 -HTML viewer\&.  Defaults to \fBnetscape\fP(1)\&.
42 +HTML viewer\&. The default is to use a program through
43 +\fBxdg-open\fP\&.
44  .IP "\fB$TEXDOCVIEW_txt\fP" 
45 -Text viewer\&.  Defaults to \fB$PAGER-more\fP\&.
46 +Text viewer\&.  Defaults is to use the program specified
47 +by the freedesktop standard\&.
48  .PP 
49  The environment variables should be set with a ``%s\&'\&' as a placeholder
50  for the name of the file\&.  For example,
51 @@ -66,10 +75,18 @@ hostname$ TEXDOCVIEW_html="mozilla %s"
52  hostname$ export TEXDOCVIEW_html
53  .EE 
54  .PP 
55 +.SH "SPECIFIC TO DEBIAN AND FEDORA"
56 +.PP
57 +The Debian and Fedora TeX Live packages texdoc use the mime-support package to determine
58 +the appropriate viewer for the respective file type except for
59 +\fIdvi\fP. texdoc of Debian and Fedora is able to handle gzip- and
60 +bzip2-compressed files. If texdoc finds more than on file for a string
61 +the first hit is displayed. The file extensions are regarded and the
62 +search order can be configured in \fItexmf.cnf\fP (\fI90TeXDoc.cnf\fP).
63 +.PP 
64  .SH "SEE ALSO" 
65  .PP 
66 -\fBacroread\fP(1), \fBgv\fP(1), \fBkpsewhich\fP(1),
67 -\fBless\fP(1), \fBmore\fP(1), \fBxdvi\fP(1)
68 +\fBxdg-open\fP(1)
69  .PP 
70  Web page: <http://tug\&.org/teTeX/>
71  .PP 
72 diff -up texlive-2007/texk/tetex/texdoc.texdoc texlive-2007/texk/tetex/texdoc
73 --- texlive-2007/texk/tetex/texdoc.texdoc       2006-01-17 22:41:51.000000000 +0100
74 +++ texlive-2007/texk/tetex/texdoc      2008-01-22 09:39:17.000000000 +0100
75 @@ -17,6 +17,15 @@
76  #
77  # Support for compressed documentation implemented by adopting changes
78  # made by debian. Thomas Esser, Dec. 2004.
79 +#
80 +# Debian specific changes:
81 +#    Denis Barbier <barbier@imacs.polytechnique.fr>, Feb 15 2000
82 +#  * accept gzipped files on input
83 +#  * temporary directory set according to TMPDIR
84 +#    
85 +#    Frank Küster <frank@debian.org>, 2004-11-23
86 +#  * do not uncompress dvi.gz, xdvi can handle this
87 +#  * go to background with uncompressed files
88  
89  test -f /bin/sh5 && test -z "$RUNNING_SH5" \
90    && { UNAMES=`uname -s`; test "x$UNAMES" = xULTRIX; } 2>/dev/null \
91 @@ -30,22 +39,22 @@ unset RUNNING_BSH
92  
93  export PATH
94  
95 -needsCleanup=false
96 +# needsCleanup=false
97  progname=texdoc
98 -tmpdir=${TMPDIR-${TEMP-${TMP-/tmp}}}/$progname.$$
99 +# tmpdir=${TMPDIR-${TEMP-${TMP-/tmp}}}/$progname.$$
100  
101  ###############################################################################
102  # setupTmpDir()
103  #   set up a temp directory and a trap to remove it
104  ###############################################################################
105 -setupTmpDir()
106 -{
107 -  $needsCleanup && return
108 +# setupTmpDir()
109 +# {
110 +#   $needsCleanup && return
111  
112 -  trap 'cleanup --force' 1 2 3 7 13 15
113 -  needsCleanup=true
114 -  mkdir "$tmpdir" || abort "could not create directory \`$tmpdir'"
115 -}
116 +#   trap 'cleanup --force' 1 2 3 7 13 15
117 +#   needsCleanup=true
118 +#   mkdir "$tmpdir" || abort "could not create directory \`$tmpdir'"
119 +# }
120  
121  ###############################################################################
122  # abort(errmsg) 
123 @@ -65,15 +74,21 @@ abort()
124  ###############################################################################
125  cleanup()
126  {
127 -  case $1 in
128 -    --force)
129 -        $needsCleanup && test -n "$tmpdir" && test -d "$tmpdir" \
130 -          && { rm -f "$tmpdir"/*; cd /; rmdir "$tmpdir"; }
131 -        ;;
132 -    *)  # directory might not be empty if some other viewer is still
133 -        # running, so be quiet about it
134 -        rmdir $tmpdir >/dev/null 2>&1;;
135 -  esac
136 +#   case $1 in
137 +#     --force)
138 +#         $needsCleanup && test -n "$tmpdir" && test -d "$tmpdir" \
139 +#           && { rm -f "$tmpdir"/*; cd /; rmdir "$tmpdir"; }
140 +#         ;;
141 +#     *)  # directory might not be empty if some other viewer is still
142 +#         # running, so be quiet about it
143 +#         rmdir $tmpdir >/dev/null 2>&1;;
144 +#   esac
145 +  # is the temporary directory empty? If not, texdoc was called with 
146 +  # two or more arguments, and one viewer is still running
147 +  if test "`echo $tmpdir/*`" = $tmpdir/'*'
148 +  then
149 +    rm -rf $tmpdir
150 +  fi
151  }
152  
153  
154 @@ -91,13 +106,12 @@ case `(uname -s) 2>/dev/null` in
155          extlist='.pdf .ps .txt .dvi .html'
156         ;;
157    *)
158 -       : ${TEXDOCVIEW_dvi='(xdvi %s) &'}
159 -       : ${TEXDOCVIEW_pdf='(acroread %s) &'}
160 -       : ${TEXDOCVIEW_ps='(gv %s) &'}
161 -       : ${TEXDOCVIEW_html='mozilla -remote openURL'"'(%s)'"' 2>/dev/null || mozilla %s &'}
162 -       : ${TEXDOCVIEW_txt="${PAGER-more} %s"}
163 -       : ${TEXDOCVIEW_="${PAGER-more} %s"} # no extension, default to pager
164 -        extlist='.dvi .dvi.gz .dvi.bz2 .pdf .pdf.gz .pdf.bz2 .ps .ps.gz .ps.bz2 .txt .txt.gz .txt.bz2 .html'
165 +       : ${TEXDOCVIEW_dvi='(xdg-open %s) &'}
166 +       : ${TEXDOCVIEW_pdf='(xdg-open %s) &'}
167 +       : ${TEXDOCVIEW_ps='(xdg-open %s) &'}
168 +       : ${TEXDOCVIEW_html='(xdg-open %s) &'}
169 +       : ${TEXDOCVIEW_txt='(xdg-open %s) &'}
170 +       : ${TEXDOCVIEW_='(xdg-open %s) &'}
171  
172          # Commands run to uncompress files, according to filename extension.
173          : ${TEXDOCUNZIP_gz='gzip -d -c'}
174 @@ -105,6 +119,10 @@ case `(uname -s) 2>/dev/null` in
175         ;;
176  esac
177  
178 +extlist=`kpsewhich --expand-brace='$TEXDOCEXT' | tr ':' ' '`
179 +test -z "$extlist" && \
180 +extlist='.dvi .dvi.gz .dvi.bz2 .pdf .pdf.gz .pdf.bz2 .ps .ps.gz .ps.bz2 .txt .txt.gz .txt.bz2 .html'
181 +
182  mode=viewer
183  help='Usage: texdoc [OPTION]... [NAME]...
184    Search for NAME in the TeX documentation and start a viewer.
185 @@ -136,11 +154,14 @@ case $# in
186      ;;
187  esac
188  
189 +tmpdir=`mktemp -d -t texdoc.XXXXXXXX`
190 +trap 'rc=$?; cleanup; exit $rc' 1 2 6 13 15
191 +
192  for name
193  do
194    case $mode in
195      search)
196 -      find `kpsewhich --expand-path='$TEXMF/doc' | tr : ' '` -type f -print |
197 +      find `kpsewhich --expand-path='$TEXDOCS' | tr : ' '` -follow -type f -print |
198          egrep $name
199        continue
200        ;;
201 @@ -153,7 +174,6 @@ do
202  
203    found=false
204    for ext in "" $extlist; do
205 -
206      filename=`kpsewhich -format='TeX system documentation' $name$ext 2>/dev/null`
207      test -z "$filename" && continue
208      found=true
209 @@ -177,7 +197,6 @@ do
210          # than once
211          test -f "$tmpdir/$src" && break
212  
213 -        setupTmpDir
214          eval "$uncompress $filename > $tmpdir/$src"
215          filename=$tmpdir/$src
216          viewer=`eval echo $viewer | sed -e "s|%s|$filename; rm -f $filename; cleanup|"`
This page took 0.06256 seconds and 3 git commands to generate.