#!/bin/sh -e # Copyright 2008 Norbert Preining # This file is licensed under the GNU General Public License version 2 # or any later version. # # Update a TeX Live tlnet area, with testing. vc_id='$Id$' unset CDPATH unset LS_COLORS chicken=false critical= recreate= yyyy=2008 while test $# -gt 0; do case $1 in --critical) critical=--all;; --dry-run|-n) chicken=true;; --master) shift; Master=$1;; --recreate) recreate=--recreate;; --testlocation) shift; tlwebtrybase=$1;; --help) echo "xxtodo. Sorry."; exit 0;; --version) echo "$vc_id"; exit 0;; --*) echo "$0: unrecognized option \`$1'." >&2 exit 1;; *) tlweb=$1;; esac shift done test -z "$tlweb" && tlweb=/home/ftp/texlive/tlnet/$yyyy if test -z "$Master"; then mydir=`dirname $0` Master=`cd $mydir/../.. && pwd` fi if test ! -r "$tlweb/tlpkg/texlive.tlpdb"; then echo "$0: no tlpdb in $tlweb/tlpkg, goodbye." >&2 exit 1 fi # Keep the default out of ~ftp/texlive/tlnet, which CTAN mirrors. test -z "$tlwebtrybase" \ && tlwebtrybase=`cd $tlweb/../.. && pwd`/tlnet-trial-`date +%y%m%d` tlwebtry=$tlwebtrybase/tlsrc.try echo "$0: using tlweb=$tlweb" # top level network directory, mirrored echo "$0: using tlwebtry=$tlwebtry" # local working dir # # Be sure we're starting the test cleanly. rm -rf $tlwebtrybase mkdir -p $tlwebtry cp -al $tlweb/* $tlwebtry # assuming GNU cp # Update packages in our working dir. echo "$0: Updating $tlwebtry in cow-shell..." cd $tlwebtry cow-shell <texlive.profile echo "$0: Running test install (log: `pwd`/install.log)..." perl install-tl -location $tlwebtry -profile texlive.profile >install.log 2>&1\ || true # install-tl can fail, but we test the output, so don't abort. # the following long grep command should filter away all *normal* # installation messages. # if there are any other messages they will end up on stdout and # thus be noticed. unexpected_output=`cat install.log \ | grep -Ev '^Automated TeX Live installation using profile' \ | grep -Ev '^Installing from:' \ | grep -Ev '^Platform: ' \ | grep -Ev '^Distribution: inst' \ | grep -Ev '^Directory for temporary files' \ | grep -Ev '^Loading ' \ | grep -Ev '^Installing to:' \ | grep -Ev '^Installing: ' \ | grep -Ev '^(re-)?running mktexlsr' \ | grep -Ev '^mktexlsr: Updating ' \ | grep -Ev '^mktexlsr: Done' \ | grep -Ev '^writing fmtutil.cnf data to' \ | grep -Ev '^writing updmap.cfg to' \ | grep -Ev '^writing language.(dat|def) data to' \ | grep -Ev '^running updmap-sys' \ | grep -Ev '^pre-generating all format file' \ | grep -Ev 'running post install action for' \ | grep -Ev '^ See \./index.html for links to documentati' \ | grep -Ev '^ (http://tug.org/texlive/) contains any upda' \ | grep -Ev '^ TeX Live is a joint project of the TeX user groups' \ | grep -Ev '^ please consider supporting it by joining the group b' \ | grep -Ev '^ list of groups is available on the web at' \ | grep -Ev '^ Add ' \ | grep -Ev '^ Most importantly, add ' \ | grep -Ev '^ to your PATH for current and future sessions' \ | grep -Ev '^ Welcome to TeX Live' \ | grep -Ev 'install-tl: done' \ | grep -Ev '^Logfile: ' \ | cat` # if test -z "$unexpected_output"; then # no unexpected output, so ship the new packages. cd $tlwebtrybase if $chicken; then echo "$0: Chicken mode, not updating anything." else rm -rf $tlweb mv $tlwebtry $tlweb echo "$0: Updated, removing test installation in $tlwebtrybase." rm -rf $tlwebtrybase echo "$0: Done." fi exit 0 else echo "$0: Test installation failed, not removing anything!" >&2 echo "$0: (Don't forget to clean up later, please.)" >&2 echo "$0: Here is the unexpected output:" >&2 echo "$unexpected_output" >&2 echo echo "$0: Full transcript file: `pwd`/install.log" >&2 echo "$0: install-tl's complete log file: $tlwebtryinst/$yyyy/install-tl.log" >&2 exit 1 fi