summaryrefslogtreecommitdiff
path: root/Master/tl-portable.sh
diff options
context:
space:
mode:
authorSiep Kroonenberg <siepo@cybercomm.nl>2008-04-04 08:18:08 +0000
committerSiep Kroonenberg <siepo@cybercomm.nl>2008-04-04 08:18:08 +0000
commit02f6b96882b822406cb12a54d7a5ee6daff17630 (patch)
treeb86a1154aca3ce6fcb0ddd0b3200fcd4773331f9 /Master/tl-portable.sh
parent48b4beb6f4a7d5acf224b4d9a0845eddb0c4a18f (diff)
Win32: .texlua command now uses %TEXBINDIR%; [un]setenv_reg
tl-portable.sh: bugfix TEXDIR; write test for $TEXDIR git-svn-id: svn://tug.org/texlive/trunk@7313 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/tl-portable.sh')
-rwxr-xr-xMaster/tl-portable.sh29
1 files changed, 22 insertions, 7 deletions
diff --git a/Master/tl-portable.sh b/Master/tl-portable.sh
index 678a4d6df6e..a1a41ec54f9 100755
--- a/Master/tl-portable.sh
+++ b/Master/tl-portable.sh
@@ -4,8 +4,12 @@
#calculate TeXLive root
#it appears that dirname isn't always available
-TEXDIR=$0
-TEXDIR=${TEXDIR%/*}
+TEXDIR0=$0
+TEXDIR=${TEXDIR0%/*}
+if test "$TEXDIR" = "$TEXDIR0"; then
+ TEXDIR="."
+fi
+unset TEXDIR0
dirsave=`pwd`
cd $TEXDIR
@@ -13,13 +17,27 @@ TEXDIR=`pwd`
export TEXDIR
cd $dirsave
-# test whether the TeXLive directory is writable.
+# Test whether the TeXLive directory is writable. We need an actual
+# write test, because network drives aren't always identified
+# correctly. We accept negatives at face value.
if test -w $TEXDIR; then
- tlwrite=$TEXDIR
+# make sure $TEXDIR is really writable
+$testfile=1
+ while test -e $TEXDIR/$testfile
+ do testfile=`expr $testfile + 1`
+ done
+ echo Hello >$TEXDIR/testfile 2>/dev/null
+ if test -e $TEXDIR/$testfile; then
+ rm $TEXDIR/$testfile
+ tlwrite=$TEXDIR
+ else
+ tlwrite=$HOME/.texlive2008
+ fi
else
tlwrite=$HOME/.texlive2008
fi
+export tlwrite
# Use $TEXMFHOME for private data,
# $TEXMFLOCAL for department- or workgroup data.
@@ -63,9 +81,6 @@ if $TEXDIR/install-tl.pl --portable; then :; else
exit 1
fi
-# Set custom prompt for secondary shell, but
-# I know of no good way to do this for the C shell.
-
# Try to block initialization scripts.
# Set custom prompt for secondary shell, but
# I know of no good way to do this for the C shell.