diff options
author | Norbert Preining <preining@logic.at> | 2009-04-30 12:00:07 +0000 |
---|---|---|
committer | Norbert Preining <preining@logic.at> | 2009-04-30 12:00:07 +0000 |
commit | 7c1101a854a753a2b32e6b264e91b49c0749c0b4 (patch) | |
tree | 044ee0038699f7e5faecf951aa0a7d15f4938d7a /Master/tlpkg/etc | |
parent | 8fd14d6af79f1a0a3d81bb65d4db1d65b13dc419 (diff) |
check in the runme.sh script for the makeself, and extend it with
initial installation support
git-svn-id: svn://tug.org/texlive/trunk@12891 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/tlpkg/etc')
-rwxr-xr-x | Master/tlpkg/etc/makeself-runscript.sh | 135 |
1 files changed, 135 insertions, 0 deletions
diff --git a/Master/tlpkg/etc/makeself-runscript.sh b/Master/tlpkg/etc/makeself-runscript.sh new file mode 100755 index 00000000000..3ffac9de66a --- /dev/null +++ b/Master/tlpkg/etc/makeself-runscript.sh @@ -0,0 +1,135 @@ +#!/bin/sh +# Updater for tlmgr and infrastructure on Unix. +# Runs in unpacked archive directory. + +# TODO +# for NEWINST: +# - create several directories (texmf-config, texmf-var etc) +# - call tlmgr generate ... ?? will it work? + +NEWINST=0 + +if [ "$1" = "-new-install" ] ; then + if [ -z "$2" ] ; then + echo "option -new-install needs the destination folder." >&2 + echo "terminating." + exit 1 + fi + NEWINST=1 + ROOT="$2" + # make sure that we die if something breaks here + set -e + mkdir -p "$ROOT/tlpkg/tlpobj" + mkdir -p "$ROOT/bin" +else + NEWINST=0 + ROOT=`kpsewhich --var-value=SELFAUTOPARENT` + if test -r "$ROOT/tlpkg/texlive.tlpdb"; then + # nothing to do here + : + else + cat <<END_ABORT_NODIR >&2 +$0: Cannot find TeX Live root using kpsewhich --var-value=SELFAUTOPARENT. +$0: Please call update-tlmgr-latest.sh --noexec --keep +$0: and then call the runme.sh script in the unpacked directory +$0: with the directory root as the first argument, something like: +$0: sh runme.sh /path/to/your/texlive/installation/2008 +END_ABORT_NODIR + exit 1 + fi +fi + + +# +# from now on we are in the normal update path +# +if [ $NEWINST = 1 ] ; then + echo "$0: installing to $ROOT..." +else + echo "$0: updating in $ROOT..." +fi + +# move the architecture-specific files to the top level. +mv ./master/bin . +mv ./master/tlpkg/installer . +mv ./master/tlpkg/tlpobj . + +# install the architecture-independent files. +(cd master && tar cf - *) | (cd $ROOT && tar xf -) + +# try to get the list of installed architectures by listing the +# directories in $ROOT/bin. +t_objdir=$ROOT/tlpkg/tlpobj # target tlpobj directory +t_instdir=$ROOT/tlpkg/installer # target installer dir + +# ensure these target directories exist. +mkdir -p $t_instdir/lzma +mkdir -p $t_instdir/wget + +# start the list of tlpobjs we will install +tlpobjs="$t_objdir/bin-texlive.tlpobj $t_objdir/texlive.infra.tlpobj" + +if [ $NEWINST = 1 ] ; then + # use config.guess and platform code to get the current platform + archs=`perl installer/platform.pl installer/config.guess` +else + archs=`ls -d $ROOT/bin/*` +fi +echo "archs = $archs" + +cp tlpobj/bin-texlive.tlpobj tlpobj/texlive.infra.tlpobj $t_objdir +for a in $archs; do + if [ $NEWINST = 0 ] ; then + test -d "$a" || continue # skip any cruft files + b=`basename $a` # just the architecture name + else + b=$a + fi + + cp tlpobj/bin-texlive.$b.tlpobj tlpobj/texlive.infra.$b.tlpobj $t_objdir + # add the tlpobjs for this platform t the list. + tlpobjs="$tlpobjs $t_objdir/bin-texlive.$b.tlpobj" + tlpobjs="$tlpobjs $t_objdir/texlive.infra.$b.tlpobj" + + # install the bin dir for this platform. + (cd bin && tar cf - $b) | (cd $ROOT/bin && tar xf -) + + # copy the installer binaries. + cp installer/lzma/lzmadec.$b $t_instdir/lzma/ + cp installer/lzma/lzma.$b $t_instdir/lzma/ + test -r installer/wget/wget.$b \ + && cp installer/wget/wget.$b $t_instdir/wget +done + +# move the architecture-specific files back to the right place +mv bin ./master/ +mv installer ./master/tlpkg/ +mv tlpobj ./master/tlpkg/ + +# +if [ $NEWINST = 1 ] ; then + # if we are installing a new we have to create a minimal tlpdb + echo "name 00texlive-installation.config +category TLCore +depend platform:$archs +depend location:http://mirror.ctan.org/systems/texlive/tlnet/2008 +depend opt_paper:a4 +depend opt_create_formats:0 +depend opt_create_symlinks:0 +depend opt_sys_bin:/usr/local/bin +depend opt_sys_info:/usr/local/info +depend opt_sys_man:/usr/local/man +depend opt_install_docfiles:1 +depend opt_install_srcfiles:1 +depend available_architectures:$archs +" > $ROOT/tlpkg/texlive.tlpdb +fi + +# invoke secret tlmgr action with the tlpobjs we found. +# Hopefully the result will be a clean tlpdb state. +if [ $NEWINST = 1 ] ; then + export PATH="$ROOT/bin/$archs:$PATH" + echo "PATH = $PATH\n"; +fi +tlmgr -v _include_tlpobj $tlpobjs +echo "$0: done." |