diff options
author | Karl Berry <karl@freefriends.org> | 2008-07-27 23:52:02 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2008-07-27 23:52:02 +0000 |
commit | 7631900eddd1bf6d452dda200f6793e4e08bddf3 (patch) | |
tree | e7bb6754cb0c6e2f5f9bdc0051f7b0fbf812d67e /Master/tlpkg/bin/tl-update-tlnet | |
parent | fae241fc1f9e3583247cda32e6a565750357fc44 (diff) |
add chicken mode to update-tlnet, rationalize msgs, etc.
git-svn-id: svn://tug.org/texlive/trunk@9829 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/tlpkg/bin/tl-update-tlnet')
-rwxr-xr-x[-rw-r--r--] | Master/tlpkg/bin/tl-update-tlnet | 163 |
1 files changed, 86 insertions, 77 deletions
diff --git a/Master/tlpkg/bin/tl-update-tlnet b/Master/tlpkg/bin/tl-update-tlnet index cbf0ab426d6..d2fc4c2de07 100644..100755 --- a/Master/tlpkg/bin/tl-update-tlnet +++ b/Master/tlpkg/bin/tl-update-tlnet @@ -1,6 +1,9 @@ #!/bin/sh -e -# Update a TeX Live tlnet distribution - +# 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 distribution, with testing. # # TODO: # - only remove the old tlnet and move the newly one to the old place in case @@ -8,72 +11,74 @@ # of tl-update-containers (is that trustworthy?), OTOH the install packages # size (md5sums?) # - other tests with the installed system? -# -set -e +# - help msg. vc_id='$Id$' unset CDPATH unset LS_COLORS +chicken=false + 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 + --dry-run|-n) chicken=true;; + --master) shift; Master=$1;; + --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 -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 - +test -z "$tlweb" && tlweb=/home/ftp/texlive/tlnet/tldev 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` +if test ! -r "$tlweb/tlpkg/texlive.tlpdb"; then + echo "$0: no tlpdb in $tlweb/tlpkg, goodbye." >&2 + exit 1 fi +test -z "$tlwebtrybase" \ +&& tlwebtrybase=`cd $tlweb/../..; pwd`/tlnet-trial-`date +%y%m%d` + # 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? + +# Be sure we're starting clean. +rm -rf $tlwebtry mkdir -p $tlwebtry -echo "using tlweb=$tlweb" -echo "using tltry=$tlwebtry" -cp -al $tlweb/* $tlwebtry +echo "$0: using tlweb=$tlweb" +echo "$0: using tltry=$tlwebtry" +cp -al $tlweb/* $tlwebtry # assuming GNU cp +echo "$0: Updating in cow-shell..." cd $tlwebtry cow-shell <<EOF -echo "Updating containers" +echo "$0: Updating containers..." $Master/tlpkg/bin/tl-update-containers -location $tlwebtry -echo "Updating installer packages" +echo "$0: Updating installer packages..." $Master/tlpkg/bin/tl-update-install-pkg -o $tlwebtry EOF # Now we have an updated tlweb in $tlwebtry where only the changed files -# are actual files, the rest are hard links -# now try to make a test installation +# are actual files, the rest are hard links. +# Try to make a test installation. cd $tlwebtrybase -tar -xzf $tlwebtry/install-tl-unx.tar.gz +zcat $tlwebtry/install-tl-unx.tar.gz | tar -xf - cd install-tl # create profile: echo "# texlive-profile -selected_scheme scheme-full +selected_scheme scheme-minimal TEXDIR $tlwebtrybase/TLTEST/2008 TEXDIRW $tlwebtrybase/TLTEST/2008 TEXMFHOME ~/texmf @@ -85,55 +90,59 @@ option_fmt 1 option_letter 0 option_src 1 option_symlinks 0 -" > texlive.profile +" >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!! +echo "$0: Making test installation (see `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!! # 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 +# 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 '^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 test -z "$unexpected_output"; then + # no unexpected output, so ship the new packages. cd $tlwebtrybase - rm -rf $tlweb - mv $tlwebtry $tlweb - echo "Everything updated, removing test installation" - rm -rf $tlwebtrybase - echo "Done" + if $chicken; then + echo "$0: Chicken mode, not updating anything." + else + rm -rf $tlweb + mv $tlwebtry $tlweb + echo "$0: Updated, removing test installation." + rm -rf $tlwebtrybase + echo "$0: Done." + fi + exit 0 else - echo "TEST INSTALLATION FAILED, HERE IS THE OUTPUT:" - echo "NOT REMOVING ANYTHING!" - cat install.log + echo "$0: Test installation failed, not removing anything!" >&2 + echo "$0: Here is the output:" >&2 + cat install.log >&2 + exit 1 fi - - |