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

Bug#141086: tetex-bin: Puts files in /usr/local



tags 141086 + patch
tags 141086 + pending
thanks


"mdz" == Matt Zimmerman <mdz@debian.org> writes:
"CMC" == C.M. Connelly <cmc@debian.org>

    >> As for longer-term fixes, we can either modify stuff so
    >> that the ls-R file ends up in /var (like the one for
    >> /usr/share/texmf/), or we can modify the TEXMF variable to
    >> not require an ls-R file.  The first option is better, the
    >> second option is easy.

    mdz> Unfortunately, the method used for /usr/share/texmf
    mdz> involves the creation of a symlink into /var.  This is
    mdz> fine in that case, but is unacceptable for /usr/local,
    mdz> where you are not allowed to create any files (policy
    mdz> manual 10.1.2).

Hmm.

    mdz> So the second option would be a better choice.  If the
    mdz> admin decides to create an ls-R file there, he is
    mdz> responsible for keeping it up to date (and if desired,
    mdz> setting things up so that it is used).

Here are two patches to implement the second option.

The first one modifies /etc/texmf/texmf.d/05TeXMF to remove the
exclamation marks that force kpathsea tools to only search the
ls-R file by default.

Index: texmf.d/05TeXMF
===================================================================
RCS file: /cvs/tetex/tetex-bin/texmf.d/05TeXMF,v
retrieving revision 1.2
diff -u -r1.2 05TeXMF
--- texmf.d/05TeXMF	2002/03/16 00:22:50	1.2
+++ texmf.d/05TeXMF	2002/04/06 00:38:23
@@ -70,7 +70,7 @@
 
 % Now, list all the texmf trees. If you have multiple trees you can
 % use shell brace notation, like this:
-TEXMF = {$HOMETEXMF,!!$TEXMFLOCAL,!!$TEXMFOLDLOCAL,!!$TEXMFMAIN}
+TEXMF = {$HOMETEXMF,$TEXMFLOCAL,$TEXMFOLDLOCAL,!!$TEXMFMAIN}
 % The braces are necessary.  If you set VARTEXMF, you also have to
 %   - list $VARTEXMF in the TEXMF definition;
 %   - make sure that $VARTEXMF precedes $TEXMFMAIN in the TEXMF definition.


The seconf patch modifies /etc/cron.daily/tetex-bin to prevent it
from creating or updating an ls-R file in /usr/local.

Index: debian/cron.daily
===================================================================
RCS file: /cvs/tetex/tetex-bin/debian/cron.daily,v
retrieving revision 1.2
diff -u -r1.2 cron.daily
--- debian/cron.daily	2002/03/20 06:55:59	1.2
+++ debian/cron.daily	2002/04/06 02:10:29
@@ -2,9 +2,28 @@
 #
 # tetex-bin	rebuild ls-R daily
 
-if [ -x "/usr/bin/mktexlsr" ]
-then
-  /usr/bin/mktexlsr > /dev/null
+# Respect the Filesystem Hierarchy Standards, and avoid writing files
+# in /usr.  Because Debian has avoided this problem for
+# /usr/share/texmf/ by creating a link to /var/lib/texmf/ls-R, we only
+# need to worry about writing to /usr/local/{share,lib}/texmf/ls-R.
+
+FHS=1 # Set this variable to zero to allow mktexlsr to regenerate ls-R
+      # files in the /usr/local/ hierarchy.
+
+if [ -x "/usr/bin/mktexlsr" ]; then
+  if [ $FHS = 1 ]; then
+    LSRDBS=`kpsewhich --show-path=ls-R | sed -e 's/:/ /g'`
+    for dbfile in ${LSRDBS}; do
+      case "$dbfile" in
+        /usr/local*) continue ;;
+        *) /usr/bin/mktexlsr $dbfile > /dev/null ;;
+      esac
+    done
+  else
+    /usr/bin/mktexlsr > /dev/null
+  fi
 fi 
 
 exit 0
+
+

If anyone else wants to rewrite this cron script to be more
elegant, feel free.  It would probably be better to have the
configuration set in some other way, perhaps by having the script
test for the existence of a ``respect_the_FHS'' file somewhere on
the filesystem.  And, of course, we need to let people upgrading
to this version know about the change, so they don't have their
systems break without some notice.

If it's fine, I can check it into CVS, and we can ship it with the
next version of tetex-bin.

Suggestions about where to mention the change would also be
helpful.

   CMC

+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+
 Man cannot be civilised, or be kept civilised by what he does in his
	    spare time; only by what he does as his work.
			     W.R. Lethaby
+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+
  C.M. Connelly               c@eskimo.com                   SHC, DS
+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+


-- 
To UNSUBSCRIBE, email to debian-tetex-maint-request@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org



Reply to: