From 02ef5bd0fb66e9e671229d809bcd74815d7cedcf Mon Sep 17 00:00:00 2001 From: Siep Kroonenberg Date: Thu, 22 May 2008 07:42:26 +0000 Subject: Renamed tl-portable.sh to tl-portable git-svn-id: svn://tug.org/texlive/trunk@8281 c570f23f-e606-0410-a88d-b1316a301751 --- Master/tl-portable | 112 ++++++++++++++++++++++++++++++++++++++++++++++++++ Master/tl-portable.sh | 112 -------------------------------------------------- 2 files changed, 112 insertions(+), 112 deletions(-) create mode 100755 Master/tl-portable delete mode 100755 Master/tl-portable.sh (limited to 'Master') diff --git a/Master/tl-portable b/Master/tl-portable new file mode 100755 index 00000000000..2bb47d49142 --- /dev/null +++ b/Master/tl-portable @@ -0,0 +1,112 @@ +#! /bin/sh +# Copyright 2008 Siep Kroonenberg. +# You may freely use, modify and/or distribute this file. + +#calculate TeXLive root +#it appears that dirname isn't always available +TEXDIR0=$0 +TEXDIR=${TEXDIR0%/*} +if test "$TEXDIR" = "$TEXDIR0"; then + TEXDIR="." +fi +unset TEXDIR0 + +dirsave=`pwd` +cd $TEXDIR +TEXDIR=`pwd` +export TEXDIR +cd $dirsave + +# 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 +# make sure $TEXDIR is really writable +testfile=1 + while test -e $TEXDIR/$testfile + do testfile=`expr $testfile + 1` + done + echo Testing whether $TEXDIR is writable... + touch $TEXDIR/$testfile 2>/dev/null + if test -e $TEXDIR/$testfile; then + rm $TEXDIR/$testfile + echo $TEXDIR is writable. + tlwrite=$TEXDIR + else + echo $TEXDIR is not writable. + tlwrite=$HOME/.texlive2008 + fi +else + tlwrite=$HOME/.texlive2008 +fi +export tlwrite +echo Using $tlwrite for generated files. + +# Use $TEXMFHOME for private data, +# $TEXMFLOCAL for department- or workgroup data. +# It is allright if $TEXMFLOCAL does not exist. + +TEXMFSYSVAR=$tlwrite/texmf-var +if test -d $TEXDIR/texmf-var; then + TEXMFSYSVAR=$TEXDIR/texmf-var +fi +export TEXMFSYSVAR +TEXMFSYSCONFIG=$tlwrite/texmf-config +if test -f $TEXDIR/texmf-config; then + TEXMFSYSCONFIG=$TEXDIR/texmf-config +fi +export TEXMFSYSCONFIG +TEXMFMAIN=$TEXDIR/texmf +export TEXMFMAIN +TEXMFDIST=$TEXDIR/texmf-dist +export TEXMFDIST +TEXMFLOCAL=$TEXDIR/texmf-local +export TEXMFLOCAL +TEXMFHOME=$tlwrite/texmf-home +export TEXMFHOME +TEXMFVAR=$tlwrite/texmf-var +export TEXMFVAR +TEXMFCONFIG=$tlwrite/texmf-config +export TEXMFCONFIG + +platform=`$TEXDIR/install-tl --print-arch` + +if test "$platform" = ""; then + echo 'Platform unsupported' + exit 1 +elif test ! -d $TEXDIR/bin/$platform; then + echo 'Platform unsupported' + exit 1 +fi + +if $TEXDIR/install-tl --portable; then :; else + echo Initialization of TeXLive failed! + exit 1 +fi + +# 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. + +ENV=/dev/null +export ENV +PATH=$TEXDIR/bin/$platform:$PATH +export PATH +if test "$SHELL" = /bin/bash; then + PS1='TL \w\$ ' + export PS1 + exec $SHELL --norc -i +elif test "$SHELL" = /bin/zsh; then + PS1='TL %d%% ' + export PS1 + exec $SHELL -f -i +elif test "$SHELL" = /bin/csh; then + exec $SHELL -f -i +elif test "$SHELL" = /bin/tcsh; then + exec $SHELL -f -i +else + PS1='TL $PWD\$ ' + export PS1 + exec $SHELL -f -i +fi diff --git a/Master/tl-portable.sh b/Master/tl-portable.sh deleted file mode 100755 index 2bb47d49142..00000000000 --- a/Master/tl-portable.sh +++ /dev/null @@ -1,112 +0,0 @@ -#! /bin/sh -# Copyright 2008 Siep Kroonenberg. -# You may freely use, modify and/or distribute this file. - -#calculate TeXLive root -#it appears that dirname isn't always available -TEXDIR0=$0 -TEXDIR=${TEXDIR0%/*} -if test "$TEXDIR" = "$TEXDIR0"; then - TEXDIR="." -fi -unset TEXDIR0 - -dirsave=`pwd` -cd $TEXDIR -TEXDIR=`pwd` -export TEXDIR -cd $dirsave - -# 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 -# make sure $TEXDIR is really writable -testfile=1 - while test -e $TEXDIR/$testfile - do testfile=`expr $testfile + 1` - done - echo Testing whether $TEXDIR is writable... - touch $TEXDIR/$testfile 2>/dev/null - if test -e $TEXDIR/$testfile; then - rm $TEXDIR/$testfile - echo $TEXDIR is writable. - tlwrite=$TEXDIR - else - echo $TEXDIR is not writable. - tlwrite=$HOME/.texlive2008 - fi -else - tlwrite=$HOME/.texlive2008 -fi -export tlwrite -echo Using $tlwrite for generated files. - -# Use $TEXMFHOME for private data, -# $TEXMFLOCAL for department- or workgroup data. -# It is allright if $TEXMFLOCAL does not exist. - -TEXMFSYSVAR=$tlwrite/texmf-var -if test -d $TEXDIR/texmf-var; then - TEXMFSYSVAR=$TEXDIR/texmf-var -fi -export TEXMFSYSVAR -TEXMFSYSCONFIG=$tlwrite/texmf-config -if test -f $TEXDIR/texmf-config; then - TEXMFSYSCONFIG=$TEXDIR/texmf-config -fi -export TEXMFSYSCONFIG -TEXMFMAIN=$TEXDIR/texmf -export TEXMFMAIN -TEXMFDIST=$TEXDIR/texmf-dist -export TEXMFDIST -TEXMFLOCAL=$TEXDIR/texmf-local -export TEXMFLOCAL -TEXMFHOME=$tlwrite/texmf-home -export TEXMFHOME -TEXMFVAR=$tlwrite/texmf-var -export TEXMFVAR -TEXMFCONFIG=$tlwrite/texmf-config -export TEXMFCONFIG - -platform=`$TEXDIR/install-tl --print-arch` - -if test "$platform" = ""; then - echo 'Platform unsupported' - exit 1 -elif test ! -d $TEXDIR/bin/$platform; then - echo 'Platform unsupported' - exit 1 -fi - -if $TEXDIR/install-tl --portable; then :; else - echo Initialization of TeXLive failed! - exit 1 -fi - -# 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. - -ENV=/dev/null -export ENV -PATH=$TEXDIR/bin/$platform:$PATH -export PATH -if test "$SHELL" = /bin/bash; then - PS1='TL \w\$ ' - export PS1 - exec $SHELL --norc -i -elif test "$SHELL" = /bin/zsh; then - PS1='TL %d%% ' - export PS1 - exec $SHELL -f -i -elif test "$SHELL" = /bin/csh; then - exec $SHELL -f -i -elif test "$SHELL" = /bin/tcsh; then - exec $SHELL -f -i -else - PS1='TL $PWD\$ ' - export PS1 - exec $SHELL -f -i -fi -- cgit v1.2.3