summaryrefslogtreecommitdiff
path: root/Master/bin/x86_64-darwin/mktexlsr
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2018-03-03 23:33:52 +0000
committerKarl Berry <karl@freefriends.org>2018-03-03 23:33:52 +0000
commit5fb22438e712fa5c1bf2a938ffcabc4ce650a657 (patch)
tree14bc4a42a38bcc625eba24cf25fb0710c382ed71 /Master/bin/x86_64-darwin/mktexlsr
parent49b02bd2f9b2cd0ef834c72850e519a9bec4ccd5 (diff)
tl18 pretest x86_64-darwin
git-svn-id: svn://tug.org/texlive/trunk@46806 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/bin/x86_64-darwin/mktexlsr')
-rwxr-xr-xMaster/bin/x86_64-darwin/mktexlsr15
1 files changed, 13 insertions, 2 deletions
diff --git a/Master/bin/x86_64-darwin/mktexlsr b/Master/bin/x86_64-darwin/mktexlsr
index 3161a5317ec..5fde39e2c2d 100755
--- a/Master/bin/x86_64-darwin/mktexlsr
+++ b/Master/bin/x86_64-darwin/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