From d53a9587cecf07eeebac2c67dc13bafbc343e199 Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Sun, 2 Nov 2008 19:24:41 +0000 Subject: attempt to make our makeself and its subscript more portable, and put rev number in script name; make generic name a symlink as with .exe git-svn-id: svn://tug.org/texlive/trunk@11156 c570f23f-e606-0410-a88d-b1316a301751 --- Master/tlpkg/bin/tl-makeself-from-tlnet | 132 ++++++++++++++++++-------------- Master/tlpkg/bin/tl-update-tlcritical | 4 +- 2 files changed, 77 insertions(+), 59 deletions(-) (limited to 'Master/tlpkg/bin') diff --git a/Master/tlpkg/bin/tl-makeself-from-tlnet b/Master/tlpkg/bin/tl-makeself-from-tlnet index c0380f359f2..3ef99b67847 100755 --- a/Master/tlpkg/bin/tl-makeself-from-tlnet +++ b/Master/tlpkg/bin/tl-makeself-from-tlnet @@ -1,29 +1,26 @@ -#!/usr/bin/env bash +#!/bin/sh -e # $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 +# Creates a .run file for updating the texlive.infra and bin-texlive +# packages on Unix, similar to the .exe we create for Windows. Both are +# created in the nightly cron from tl-update-tlcritical. TMP=`mktemp -d` - CWD=`pwd` -TLNET="$1" +TLNET=$1 -if [ ! -d "$TLNET" ] ; then - echo "No directory for the tlnet distribution given, aborting." +if test ! -d "$TLNET"; then + echo "$0: No tlnet directory given as argument, aborting." >&2 exit 1 fi -ARCHIVE="$TLNET/archive" - -if [ ! -d "$ARCHIVE" ] ; then - echo "archive directory in $TLNET not found, aborting." +ARCHIVE=$TLNET/archive +if test ! -d "$ARCHIVE"; then + echo "$0: subdirectory archive/ in $TLNET not found, aborting." >&2 exit 1 fi @@ -31,69 +28,90 @@ 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 +# unpack texlive.infra and bin-texlive archives for all platforms, +# except w32. +for pkg in texlive.infra bin-texlive; do + for i in $ARCHIVE/$pkg*.tar.lzma ; do + case "$i" in + *win32*) ;; + *) lzmadec <$i | tar -xf - ;; + esac + done done cd .. -# create the runme.sh script +# create the script which will be run on the user's machine to do the update. # -cat > runme.sh <<'EOF' +cat >runme.sh <<'END_RUNME' #!/bin/sh -# -# updater for tlmgr and infrastructure on unix -# +# Updater for tlmgr and infrastructure on Unix. +# Runs in unpacked archive directory. ROOT=`kpsewhich --var-value=SELFAUTOPARENT` -if [ -r "$ROOT/tlpkg/texlive.tlpdb" ] ; then +if test -r "$ROOT/tlpkg/texlive.tlpdb"; then + echo "$0: updating in $ROOT..." + + # move the architecture-specific files to the top level. 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 + + # 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" + for a in $ROOT/bin/*; do + test -d "$a" || continue # skip any cruft files + b=`basename $a` # just the architecture name + + # 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 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" + cat <&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 -tlmgr _include_tlpobj $tlpobjs - -EOF +# invoke secret tlmgr action with the tlpobjs we found. +# Hopefully the result will be a clean tlpdb state. +tlmgr -v _include_tlpobj $tlpobjs +echo "$0: done." +END_RUNME chmod ugo+x runme.sh +# make the self-extracting archive back in the directory from where we +# were invoked. cd $CWD - -makeself $TMP update-tlmgr.sh "TeX Live Manager Updater" ./runme.sh - +mydir=`cd \`dirname $0\` && pwd` # Master/tlpkg/bin +rev=`svnversion $mydir | sed s/[^0-9]//g` # just the number, no status +makeself $TMP update-tlmgr-r$rev.sh "TeX Live Manager Updater" ./runme.sh rm -rf $TMP # vim:set tabstop=2 expandtab: # diff --git a/Master/tlpkg/bin/tl-update-tlcritical b/Master/tlpkg/bin/tl-update-tlcritical index 359d3a3c0aa..6023d23002a 100755 --- a/Master/tlpkg/bin/tl-update-tlcritical +++ b/Master/tlpkg/bin/tl-update-tlcritical @@ -11,7 +11,7 @@ cd ${TMPDIR-/tmp} tlcrit=/home/ftp/texlive/tlcritical # update normal containers. -$mydir/tl-update-containers -v \ +$mydir/tl-update-containers \ -location $tlcrit -all \ 00texlive-installation.config 00texlive.config bin-texlive texlive.infra @@ -19,7 +19,7 @@ $mydir/tl-update-containers -v \ $mydir/tl-makeself-from-tlnet $tlcrit rm -f $tlcrit/update-*.sh mv -v update-*.sh $tlcrit -#(cd $tlcrit && ln -sv update-*.sh update-tlmgr-latest.sh) +(cd $tlcrit && ln -sv update-*.sh update-tlmgr-latest.sh) # update the Windows updater executable. $mydir/tl-update-nsis >updater.nsi -- cgit v1.2.3