From 320b86b13485a4443102ff53fc50f0b3e8ce70da Mon Sep 17 00:00:00 2001 From: Norbert Preining Date: Sun, 27 Jul 2008 13:15:14 +0000 Subject: add tl-update-tlnet, the update-all and make a test run before replacing script git-svn-id: svn://tug.org/texlive/trunk@9812 c570f23f-e606-0410-a88d-b1316a301751 --- Master/tlpkg/bin/tl-update-tlnet | 131 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 131 insertions(+) create mode 100644 Master/tlpkg/bin/tl-update-tlnet diff --git a/Master/tlpkg/bin/tl-update-tlnet b/Master/tlpkg/bin/tl-update-tlnet new file mode 100644 index 00000000000..fe04787c98f --- /dev/null +++ b/Master/tlpkg/bin/tl-update-tlnet @@ -0,0 +1,131 @@ +#!/bin/sh -e +# Update a TeX Live tlnet distribution + +set -e + +vc_id='$Id$' +unset CDPATH +unset LS_COLORS + +while test $# -gt 0; do + case $1 in + --master) shift; Master=$1;; + --testlocation) shift; tlwebtrybase=$1;; + --*) echo "$0: unrecognized option \`$1'." >&2 + exit 1;; + *) tlweb=$1 + esac + shift +done + +if test -z "$tlweb" ; then + tlweb=/home/ftp/texlive/tlnet/tldev +fi + +if ! [ -r "$tlweb/tlpkg/texlive.tlpdb" ] ; then + echo "Location for current tlnet $tlweb is invalid!" + exit 1 +fi + +if test -z "$Master"; then + mydir=`dirname $0` + Master=`cd $mydir/../.. && pwd` +fi + +if test -z "$tlwebtrybase" ; then + tlwebtrybase=`cd $tlweb/../..; pwd`/tlnet-trial-`date +%y%m%d` +fi +# don't trap, don't remove in case of errors +#trap "rm -rf $tlwebtrybase" 0 1 2 15 + +tlwebtry=$tlwebtrybase/tldev.try +mkdir -p $tlweb/tlpkg +# +# KARL!!! Should we remove $tlwebtry before retrying? +mkdir -p $tlwebtry + +echo "using tlweb=$tlweb" +echo "using tltry=$tlwebtry" +cp -al $tlweb/* $tlwebtry + +cd $tlwebtry +cow-shell < texlive.profile + +echo "Making test installation" +perl install-tl -location $tlwebtry -profile texlive.profile > install.log 2>&1 || true # that can fail, but we test the output!! + +# the following long grep command should filter away all *normal* +# installation messages +# if there are any other messages the will end up on stdout and thus +# mailed to the cron output ... +foo=`cat install.log | \ + grep -Ev '^Using automated installation using texlive.profile' | \ + grep -Ev '^Distribution: inst' | \ + grep -Ev '^Directory for temporary files' | \ + grep -Ev '^Installer directory:' | \ + grep -Ev '^Loading ' | \ + 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-generation 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' | \ + cat` + + +if [ -z $foo ] ; then + # there was no unexpected output, so just ship the new packages + cd $tlwebtrybase + rm -rf $tlweb + mv $tlwebtry $tlweb + echo "Everything updated, removing test installation" + rm -rf $tlwebtrybase + echo "Done" +else + echo "TEST INSTALLATION FAILED, HERE IS THE OUTPUT:" + echo "NOT REMOVING ANYTHING!" + cat install.log +fi + + -- cgit v1.2.3