#!/usr/bin/env bash # $Id: tl-makeself-from-tlnet 11099 2008-10-29 00:15:13Z preining $ # Copyright 2008 Norbert Preining # This file is licensed under the GNU General Public License version 2 # or any later version. # # Creates a .run file for updating the texlive.infra and bin-texlive packages # comparable to the windows .exe updater set -e TMP=`mktemp -d` CWD=`pwd` TLNET="$1" if [ ! -d "$TLNET" ] ; then echo "No directory for the tlnet distribution given, aborting." exit 1 fi ARCHIVE="$TLNET/archive" if [ ! -d "$ARCHIVE" ] ; then echo "archive directory in $TLNET not found, aborting." exit 1 fi cd $TMP mkdir master cd master for i in $ARCHIVE/texlive.infra*.tar.lzma ; do case "$i" in *win32*) ;; *) lzmadec < $i | tar -xvf - ;; esac done for i in $ARCHIVE/bin-texlive*.tar.lzma ; do case "$i" in *win32*) ;; *) lzmadec < $i | tar -xvf - ;; esac done cd .. # create the runme.sh script # cat > runme.sh <<'EOF' #!/bin/sh # # updater for tlmgr and infrastructure on unix # ROOT=`kpsewhich --var-value=SELFAUTOPARENT` if [ -r "$ROOT/tlpkg/texlive.tlpdb" ] ; then mv ./master/bin . mv ./master/tlpkg/installer . cp -a ./master/* $ROOT/ # now try to get the list of installed architectures by listing the # directories in $ROOT/bin tlpobjs="$ROOT/tlpkg/tlpobj/bin-texlive.tlpobj $ROOT/tlpkg/tlpobj/texlive.infra.tlpobj" mkdir -p $ROOT/tlpkg/installer/lzma mkdir -p $ROOT/tlpkg/installer/wget for a in $ROOT/bin/* ; do b=`basename $a` cp -a bin/$b $ROOT/bin/ tlpobjs="$tlpobjs $ROOT/tlpkg/tlpobj/bin-texlive.$b.tlpobj $ROOT/tlpkg/tlpobj/texlive.infra.$b.tlpobj" # we also have to copy the files from (tlpkg/)installer/lzma and ../wget cp -a installer/lzma/lzmadec.$b $ROOT/tlpkg/installer/lzma cp -a installer/lzma/lzma.$b $ROOT/tlpkg/installer/lzma if [ -r installer/wget/wget.$b ] ; then cp -a installer/wget/wget.$b $ROOT/tlpkg/installer/wget fi done else # could be made more intelligent echo "Cannot find root, please call the .run script with --noexec --keep and" echo "then call the runme.sh script in the unpacked directory with the" echo "root as the first argument, i.e., something like" echo " sh runme.sh /your/path/to/the/texlive/installaton/2008" exit 1 fi tlmgr _include_tlpobj $tlpobjs EOF chmod ugo+x runme.sh cd $CWD makeself $TMP update-tlmgr.sh "TeX Live Manager Updater" ./runme.sh rm -rf $TMP # vim:set tabstop=2 expandtab: #