Bug#93781: 93781 texdoc prefers compressed over uncompressed documents
On 25.05.01 C.M. Connelly (c@eskimo.com) wrote:
Hi,
> Still true in tetex-bin 1.0.7+20001218-3.
>
an tetex-2.0.x
> texdoc also prefers DVI over PDF or PS documentation. Thus, on my
> system, texdoc would open
>
> diziet% texdoc -v -l usrguide
> /usr/share/texmf/doc/latex/base/usrguide.dvi.gz
> /usr/local/lib/texmf/doc/latex/base/usrguide.ps.gz
>
> Another example: I have newer versions of the AMS packages
> installed in my local texmf tree. texdoc prefers the older docs
> to the newer docs:
>
> diziet% texdoc -l -v technote
> /usr/share/texmf/doc/latex/amsmath/technote.dvi.gz
> /usr/local/lib/texmf/doc/latex/amsmath/technote.dvi
>
> If I compress the local tree doc (and run mktexlsr), texdoc
> prefers the local doc:
>
> diziet% texdoc -l -v technote
> /usr/local/lib/texmf/doc/latex/amsmath/technote.dvi.gz
>
> The problem appears to be down to the following chunk of code,
> which hardcodes the order in which extensions should be preferred:
>
> #listext=`kpsewhich --expand-brace='$TEXDOCEXT'`
> #: ${listext=':.gz'}
> listext='.dvi.gz:.pdf.gz:.ps.gz:.txt.gz:.dvi:.pdf:.ps:.txt:.html:""'
>
> The script then calls kpsewhich on each extension, and stops at
> the first match unless the ``-l'' (list) flag is used.
>
> A workaround is to require that users compress docs in local texmf
> trees. A real fix would require adding code to the texdoc script
> to prefer local docs over standard docs (or, better, to pay
> attention to the order of directories in TEXMF).
>
> [My initial stab at the last, by adding a list of suffixes to the
> ``TeX system documentation'' definition, doesn't appear to have
> worked. I'm not that surprised.
>
> --- texk/kpathsea/tex-file.c.orig Thu May 6 02:38:17 1999
> +++ texk/kpathsea/tex-file.c Thu May 24 17:15:22 2001
> @@ -508,6 +508,8 @@
> break;
> case kpse_texdoc_format:
> INIT_FORMAT ("TeX system documentation", DEFAULT_TEXDOCS, TEXDOC_ENVS);
> +#define TEXDOC_SUFFIXES ".dvi" ".dvi.gz" ".html" ".pdf" ".pdf.gz" ".ps" ".ps.gz" ".txt" ".txt.gz" ""
> + SUFFIXES (TEXDOC_SUFFIXES);
> break;
> case kpse_texpool_format:
> INIT_FORMAT ("texpool", DEFAULT_TEXPOOL, TEXPOOL_ENVS);
> ]
>
Well, I prefer a more simple solution, which was discussed lately in
debian-tetex-maint. Patch is attached and should fit to an
tetex-build-tree made by dpkg-source -x . I dunno, if it is a good
idea to construct TEXDOCEXT that way, but it is configurable anyway
afterwards.
Hilmar
--
sigmentation fault
diff -urN tetex-bin-2.0.2.orig/debian/patches/patch-texdoc tetex-bin-2.0.2/debian/patches/patch-texdoc
--- tetex-bin-2.0.2.orig/debian/patches/patch-texdoc Sat Aug 2 11:09:03 2003
+++ tetex-bin-2.0.2/debian/patches/patch-texdoc Sat Aug 2 11:20:47 2003
@@ -1,5 +1,5 @@
---- tetex-bin-2.0/texk/tetex/texdoc.orig 2002-09-12 00:50:04.000000000 +0900
-+++ tetex-bin-2.0/texk/tetex/texdoc 2002-09-20 09:52:42.000000000 +0900
+--- tetex-bin-2.0/texk/tetex/texdoc.orig Wed Sep 11 17:50:04 2002
++++ tetex-bin-2.0/texk/tetex/texdoc Sat Aug 2 11:18:09 2003
@@ -13,6 +13,11 @@
#
# Changes for web2c-7.2 resp. teTeX-0.9 and portability fixes by
@@ -44,9 +44,9 @@
+ fi
+}
+
-+#listext=`kpsewhich --expand-brace='$TEXDOCEXT'`
-+#: ${listext=':.gz'}
-+listext='.dvi.gz:.pdf.gz:.ps.gz:.txt.gz:.dvi:.pdf:.ps:.txt:.html:""'
++listext=`kpsewhich --expand-brace='$TEXDOCEXT'`
++[ "x$listext" = x ] && \
++listext='.dvi.gz:.pdf.gz:.ps.gz:.txt.gz:.dvi:.pdf:.ps:.txt:.html:'
+
for name
do
diff -urN tetex-bin-2.0.2.orig/texmf.d/90TeXDoc.cnf tetex-bin-2.0.2/texmf.d/90TeXDoc.cnf
--- tetex-bin-2.0.2.orig/texmf.d/90TeXDoc.cnf Thu Jan 1 01:00:00 1970
+++ tetex-bin-2.0.2/texmf.d/90TeXDoc.cnf Sat Aug 2 11:09:54 2003
@@ -0,0 +1,7 @@
+% the default extensions for documentation
+TEXDOCSSUFFIX = .pdf:.dvi:.ps:.html:.txt
+% we allow some compression methods
+TEXDOCSCOMPRESS = :.gz:.bz2
+% and put that all now together
+TEXDOCEXT = {$TEXDOCSSUFFIX}{$TEXDOCSCOMPRESS}
+
Reply to: