diff options
author | Karl Berry <karl@freefriends.org> | 2018-03-03 18:29:03 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2018-03-03 18:29:03 +0000 |
commit | be3df25db62116ef060b36ae89fd2c3d41da4d7d (patch) | |
tree | 0927b57c937e19e51b7e0c1e239066762ff27403 /Master/bin/x86_64-linux/mktexlsr | |
parent | be898c6b1244e8e97f7bb28f2fee6313882de105 (diff) |
tl18 pretest initial setup
git-svn-id: svn://tug.org/texlive/trunk@46798 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/bin/x86_64-linux/mktexlsr')
-rwxr-xr-x | Master/bin/x86_64-linux/mktexlsr | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/Master/bin/x86_64-linux/mktexlsr b/Master/bin/x86_64-linux/mktexlsr index 8d4a38018f9..bd3eb50d6e4 100755 --- a/Master/bin/x86_64-linux/mktexlsr +++ b/Master/bin/x86_64-linux/mktexlsr @@ -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 |