On lwn.net, I noticed a potential problem in the mktexlsr script from
texlive : it uses predictable filenames and (arguably) will produce
mysterious errors if creating the temporary file fails.

This script is used to create the ls-R databases used by the
kpathsea library, and I think it gets run both during the initial
install, and if any TeX package is added or updated.  I assume this
will be fixed upstream for the 2015 release which should happen soon,
so I'm not raising a ticket.

The source file is shipped in texk/kpathsea/ and installed to
bin/$TEXARCH/

The original diff for the binary version is:
--- texlive-bin.orig/texk/kpathsea/mktexlsr
+++ texlive-bin/texk/kpathsea/mktexlsr
@@ -73,7 +73,7 @@
 dry_run=false
 trees=

-treefile="${TMPDIR-/tmp}/mktexlsrtrees$$.tmp"
+treefile=`mktemp -q --tmpdir mktexlsrtrees.XXXXXXXXXX`
 trap 'cd /; rm -f $treefile; test -z "$db_dir_tmp" || rm -rf
"$db_dir_tmp";
       exit' 0 1 2 3 7 13 15

The original reporte suggested that
treefile=`mktemp --tmpdir mktexlsrtrees.XXXXXXXXXX` || exit 1
would be better, but fedora have picked up the original, so I guess
that is already upstream.  We prefer $( ... ) to ` ... ` so the
following will achieve the same thing:

sed -i 's/\(^treefile=\).*/\1$\(mktemp -q --tmpdir mktexlsrtrees.XXXXXXXXXX\)/' 
\
/PATH/TO/mktexlsr

No doubt there are more concise ways of achieving this, and you need
to point to where the installed or source mktexlsr can be found.

ĸen
-- 
Nanny Ogg usually went to bed early. After all, she was an old lady.
Sometimes she went to bed as early as 6 a.m.
-- 
http://lists.linuxfromscratch.org/listinfo/blfs-support
FAQ: http://www.linuxfromscratch.org/blfs/faq.html
Unsubscribe: See the above information page

Reply via email to