texlive[52484] Master/tlpkg/bin/tl-update-tlnet: Add -dest option

commits+karl at tug.org commits+karl at tug.org
Tue Oct 22 00:56:43 CEST 2019


Revision: 52484
          http://tug.org/svn/texlive?view=revision&revision=52484
Author:   karl
Date:     2019-10-22 00:56:43 +0200 (Tue, 22 Oct 2019)
Log Message:
-----------
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.

Modified Paths:
--------------
    trunk/Master/tlpkg/bin/tl-update-tlnet

Modified: trunk/Master/tlpkg/bin/tl-update-tlnet
===================================================================
--- trunk/Master/tlpkg/bin/tl-update-tlnet	2019-10-21 22:53:19 UTC (rev 52483)
+++ trunk/Master/tlpkg/bin/tl-update-tlnet	2019-10-21 22:56:43 UTC (rev 52484)
@@ -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 @@
 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 <<END_NO_TLPDB >&2
 $0: fatal: no file $tlweb/tlpkg/texlive.tlpdb.
@@ -63,14 +61,22 @@
   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 @@
 
 # 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 <<END_COW
-echo "$0: Running tl-update-containers (from $Master) with"
-echo "$0:   gpgcmd=$gpgcmd critical=$critical recreate=$recreate ..."
-$Master/tlpkg/bin/tl-update-containers $gpgcmd \
-  $verbose -location $tltry $critical $recreate
+echo "$0: Updating containers with (critical=$critical recreate=$recreate gpgcmd=$gpgcmd)"
+echo "$0:   $containers_invoke"
+$containers_invoke
 
 # It is scary, but I guess we should update the installer package every
 # day, partly for the sake of doc.html and partly so it actually gets
@@ -105,9 +114,6 @@
 $Master/tlpkg/bin/tl-update-install-pkg $gpgcmd -o $tltry
 END_COW
 
-# cow-shell might leave this around.
-rm -f $tltry/.ilist
-
 # if not doing the test installation, don't push anything out.
 $testinstall || exit 0
 
@@ -140,7 +146,7 @@
 TEXLIVE_INSTALL_ENV_NOCHECK=1; export TEXLIVE_INSTALL_ENV_NOCHECK
 TEXLIVE_INSTALL_NO_WELCOME=1; export TEXLIVE_INSTALL_NO_WELCOME
 
-tlnet_install_log=`pwd`/install.log
+tlnet_install_log=`pwd`/update-tlnet-install.log
 echo "$0: Running test install (log: $tlnet_install_log)..."
 perl install-tl -location $tltry -profile texlive.profile \
   >$tlnet_install_log 2>&1 \
@@ -194,12 +200,14 @@
   | 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 @@
 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 @@
 
 # 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



More information about the tex-live-commits mailing list