From 4c4e6e13c9251eab027e09bbc0b0bfaff6fe0659 Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Mon, 21 Oct 2019 22:56:43 +0000 Subject: Add -dest option instead of using non-option arguments for dest. Use update-tlnet-install.log for our test install, install.log is too generic. Don't assume the log from install-tl itself exists. Tweak output and comments. git-svn-id: svn://tug.org/texlive/trunk@52484 c570f23f-e606-0410-a88d-b1316a301751 --- Master/tlpkg/bin/tl-update-tlnet | 65 +++++++++++++++++++++++----------------- 1 file changed, 38 insertions(+), 27 deletions(-) diff --git a/Master/tlpkg/bin/tl-update-tlnet b/Master/tlpkg/bin/tl-update-tlnet index 9fe3afddd08..3efddd47116 100755 --- a/Master/tlpkg/bin/tl-update-tlnet +++ b/Master/tlpkg/bin/tl-update-tlnet @@ -3,7 +3,10 @@ # This file is licensed under the GNU General Public License version 2 # or any later version. # -# Update a TeX Live tlnet area, with testing. +# Build a TeX Live tlnet area in a temporary directory, +# then (unless -N) do a test installation from it, +# then (if the test install succeeded), update the live area, +# all as specified in the options. vc_id='$Id$' unset CDPATH @@ -25,30 +28,25 @@ gpgcmd= while test $# -gt 0; do case $1 in --critical) critical=--all;; + --dest) shift; tlweb=$1;; --dry-run|-n) chicken=true;; + --gpgcmd) shift; gpgcmd="--gpgcmd \"$1\"";; --master) shift; Master=$1;; --no-consistency) check_consistency=false;; # takes a long time. --no-testinstall|-N) testinstall=false;; # and no updates; quit early. --pretest) tlweb=/home/ftp/texlive/tlpretest;; --recreate) recreate=--recreate;; - --scheme) shift; scheme=$1;; - --gpgcmd) shift; gpgcmd="--gpgcmd \"$1\"";; + --scheme) shift; scheme=$1;; # scheme for test install. --testlocation) shift; tltrybase=$1;; - -v|-vv|-vvv) verbose=$1;; + -v|-vv|-vvv) verbose=$1;; --help) echo "ustl. sorry."; exit 0;; --version) echo "$vc_id"; exit 0;; - --*) echo "$0: unrecognized option \`$1'." >&2 - exit 1;; - *) tlweb=$1;; + *) echo "$0: unrecognized option \`$1'; see source." >&2 + exit 1;; esac shift done -if test -z "$Master"; then - mydir=`dirname $0` - Master=`cd $mydir/../.. && pwd` -fi - if test ! -r "$tlweb/tlpkg/texlive.tlpdb"; then cat <&2 $0: fatal: no file $tlweb/tlpkg/texlive.tlpdb. @@ -63,14 +61,22 @@ END_NO_TLPDB exit 1 fi -# Keep the default out of ~ftp/texlive/tlnet, which CTAN mirrors. +# don't let cwd interfere; shouldn't matter, but just in case. +cd "$HOME" || exit 1 + +if test -z "$Master"; then + mydir=`dirname $0` + Master=`cd $mydir/../.. && pwd` +fi + +# Keep the default out of ~ftp/texlive, which CTAN mirrors much of test -z "$tltrybase" \ && tltrybase=`cd $tlweb/../.. && pwd`/tlnet-trial-`date +%y%m%d` tltry=$tltrybase/tlsrc.try -echo "$0: Using tlweb=$tlweb" # top level network directory, mirrored +echo "$0: Using tlweb=$tlweb" # top level network directory, mirrored echo "$0: Using tltry=$tltry" # local working dir -# Save tlpdb in case of disaster. +# Save current tlpdb in case of disaster. cp --force --backup $tlweb/tlpkg/texlive.tlpdb* /tmp # @@ -91,12 +97,15 @@ done # Update packages in our working dir. echo "$0: Updating $tltry with cow-shell..." +containers_prog="$Master/tlpkg/bin/tl-update-containers" +containers_args=" $verbose -location $tltry $critical $recreate $gpgcmd" +containers_invoke="$containers_prog $containers_args" +# cd $tltry cow-shell <$tlnet_install_log 2>&1 \ @@ -194,12 +200,14 @@ unexpected_output=`cat $tlnet_install_log \ | cat` failure=false +ignore_unexpected_output=false #true, if frustration if test -n "$unexpected_output"; then - failure=true + $ignore_unexpected_output || failure=true echo >&2 echo "$0: Test installation failed." >&2 - echo "$0: Here is the unexpected output:" >&2 + echo "$0: Here is the unexpected output from $tlnet_install_log:" >&2 echo "$unexpected_output" >&2 + echo "$0: (end of unexpected output)." >&2 fi # more consistency checks. @@ -229,9 +237,11 @@ if test $failure = false; then fi # Format creation check, in case fmtutil's exit status wasn't right. +# This might not exist if the test install didn't get this far. install_tl_log=$tltryinst/$yyyy/install-tl.log -if grep -i '^fmtutil.*error.*' $install_tl_log >/dev/null; then +if test ! -r $install_tl_log \ + || grep -i '^fmtutil.*error.*' $install_tl_log >/dev/null; then echo >&2 echo "$0: seems fmtutil failed, check $install_tl_log." >&2 failure=true @@ -239,7 +249,8 @@ fi # In all cases, make copies in /tmp for inspection in case of # undetected failure. -cp -f $tlnet_install_log $install_tl_log /tmp +cp -f $tlnet_install_log /tmp +test ! -r $install_tl_log || cp -f $install_tl_log /tmp if $failure; then echo >&2 -- cgit v1.2.3