summaryrefslogtreecommitdiff
path: root/Master/bin/i386-solaris/mktexlsr
diff options
context:
space:
mode:
authorMojca Miklavec <mojca.miklavec@gmail.com>2018-03-05 09:24:48 +0000
committerMojca Miklavec <mojca.miklavec@gmail.com>2018-03-05 09:24:48 +0000
commit664eeb1929dfaff3a728e285bc4f5474109be318 (patch)
treeaaa764f056051a2153f1f4c4c21baa088eadc957 /Master/bin/i386-solaris/mktexlsr
parentcc577ce8c5e051967fce0ae954f78874e400c2f8 (diff)
Initial Solaris binaries for TL2018 (r46804)
git-svn-id: svn://tug.org/texlive/trunk@46829 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/bin/i386-solaris/mktexlsr')
-rwxr-xr-xMaster/bin/i386-solaris/mktexlsr15
1 files changed, 13 insertions, 2 deletions
diff --git a/Master/bin/i386-solaris/mktexlsr b/Master/bin/i386-solaris/mktexlsr
index 3161a5317ec..5fde39e2c2d 100755
--- a/Master/bin/i386-solaris/mktexlsr
+++ b/Master/bin/i386-solaris/mktexlsr
@@ -10,7 +10,7 @@
# Originally written as `texhash' by Thomas Esser, Okt., 1994.
# Public domain.
-version='$Id: mktexlsr 36855 2015-04-14 12:15:08Z preining $'
+version='$Id: mktexlsr 46343 2018-01-17 00:55:32Z preining $'
progname=`echo $0 | sed 's%.*/%%'`
usage="Usage: $progname [OPTION]... [DIR]...
@@ -73,7 +73,18 @@ if tty -s; then verbose=true; else verbose=false; fi
dry_run=false
trees=
-treefile="${TMPDIR-/tmp}/mktexlsrtrees$$.tmp"
+# initialize treefile by either mktemp or some random name
+# code taken from pdfjam and adjusted
+{
+ treefile=`
+ (umask 077 && mktemp "${TMPDIR-/tmp}/mktexlsrtrees.XXXXXXXXXX") 2>/dev/null
+ ` && test -n "$treefile" && test -f "$treefile"
+} || {
+ ## We'll use awk to make random number, for portability
+ random=`awk 'END { srand(); printf ("%d\n", rand()*1000000); }' /dev/null`
+ treefile="${TMPDIR-/tmp}/mktexlsrtrees$$.$random"
+} || exit $?
+
trap 'cd /; rm -f $treefile; test -z "$db_dir_tmp" || rm -rf "$db_dir_tmp";
exit' 0 1 2 3 7 13 15