summaryrefslogtreecommitdiff
path: root/Master/tl-portable.sh
diff options
context:
space:
mode:
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.