texlive[55126] Master: install-tl: if envvar

commits+karl at tug.org commits+karl at tug.org
Wed May 13 19:27:10 CEST 2020


Revision: 55126
          http://tug.org/svn/texlive?view=revision&revision=55126
Author:   karl
Date:     2020-05-13 19:27:10 +0200 (Wed, 13 May 2020)
Log Message:
-----------
install-tl: if envvar TEXLIVE_INSTALL_NO_RESUME is set, omit question
about importing settings.

TLUtils.pm (install_packages): if $media != NET, abort immediately if a
package cannot be installed; no retries. Also output args if debugging.
Add TLUtils:: prefix to some other debugging lines.

TLPDB.pm: TLPDB:: prefix on debugging line.

tl-update-tlnet: show exact install-tl command that is run.
Trying shortening command prefix to basename, on most messages.

Modified Paths:
--------------
    trunk/Master/install-tl
    trunk/Master/tlpkg/TeXLive/TLPDB.pm
    trunk/Master/tlpkg/TeXLive/TLUtils.pm
    trunk/Master/tlpkg/bin/tl-update-tlnet

Modified: trunk/Master/install-tl
===================================================================
--- trunk/Master/install-tl	2020-05-13 12:01:23 UTC (rev 55125)
+++ trunk/Master/install-tl	2020-05-13 17:27:10 UTC (rev 55126)
@@ -319,7 +319,7 @@
 # continue with the installation
 # note, we are in the directory from which the aborted installation was run.
 my %profiledata;
-if (-r "installation.profile") {
+if (-r "installation.profile" && !exists $ENV{"TEXLIVE_INSTALL_NO_RESUME"}) {
   if ($from_ext_gui) { # prepare for dialog interaction
     print "mess_yesno\n";
   }
@@ -386,7 +386,7 @@
     @noperldoc = ("-noperldoc", "1");
   }
 
-  # Tweak less stuff same as tlmgr, though.
+  # Tweak less invocation same as tlmgr, though.
   # less can break control characters and thus the output of pod2usage
   # is broken.  We add/set LESS=-R in the environment and unset
   # LESSPIPE and LESSOPEN to try to help.
@@ -3154,7 +3154,7 @@
 
 Omit creating the ConTeXt cache.  This is useful for redistributors.
 
-=item C<TEXLIVE_INSTALL_NO_IMPORT>
+=item C<TEXLIVE_INSTALL_NO_RESUME>
 
 Omit check for installing on top of a previous installation and then
 asking about importing previous settings.

Modified: trunk/Master/tlpkg/TeXLive/TLPDB.pm
===================================================================
--- trunk/Master/tlpkg/TeXLive/TLPDB.pm	2020-05-13 12:01:23 UTC (rev 55125)
+++ trunk/Master/tlpkg/TeXLive/TLPDB.pm	2020-05-13 17:27:10 UTC (rev 55126)
@@ -1972,7 +1972,7 @@
     }
     my $ww = ($whatsize || "<unset>");
     my $ss = ($whatcheck || "<unset>");
-    debug("tlpdb:_install_data: what=$what, target=$target, size=$ww, checksum=$ss, tmpdir=$tempdir\n");
+    debug("TLPDB::_install_data: what=$what, target=$target, size=$ww, checksum=$ss, tmpdir=$tempdir\n");
     my ($ret, $pkg) = TeXLive::TLUtils::unpack($what, $target, 'size' => $whatsize, 'checksum' => $whatcheck, 'tmpdir' => $tempdir);
     if (!$ret) {
       tlwarn("TLPDB::_install_data: $pkg for $what\n"); # $pkg is error msg

Modified: trunk/Master/tlpkg/TeXLive/TLUtils.pm
===================================================================
--- trunk/Master/tlpkg/TeXLive/TLUtils.pm	2020-05-13 12:01:23 UTC (rev 55125)
+++ trunk/Master/tlpkg/TeXLive/TLUtils.pm	2020-05-13 17:27:10 UTC (rev 55126)
@@ -551,7 +551,7 @@
 
 sub initialize_global_tmpdir {
   $::tl_tmpdir = File::Temp::tempdir(CLEANUP => 1);
-  ddebug("initialize_global_tmpdir: creating global tempdir $::tl_tmpdir\n");
+  ddebug("TLUtils::initialize_global_tmpdir: creating global tempdir $::tl_tmpdir\n");
   return ($::tl_tmpdir);
 }
 
@@ -565,7 +565,7 @@
 sub tl_tmpdir {
   initialize_global_tmpdir() if (!defined($::tl_tmpdir));
   my $tmp = File::Temp::tempdir(DIR => $::tl_tmpdir, CLEANUP => 1);
-  ddebug("tl_tmpdir: creating tempdir $tmp\n");
+  ddebug("TLUtils::tl_tmpdir: creating tempdir $tmp\n");
   return ($tmp);
 }
 
@@ -580,7 +580,7 @@
 sub tl_tmpfile {
   initialize_global_tmpdir() if (!defined($::tl_tmpdir));
   my ($fh, $fn) = File::Temp::tempfile(@_, DIR => $::tl_tmpdir, UNLINK => 1);
-  ddebug("tl_tempfile: creating tempfile $fn\n");
+  ddebug("TLUtils::tl_tempfile: creating tempfile $fn\n");
   return ($fh, $fn);
 }
 
@@ -1510,6 +1510,10 @@
   my $totalsize = 0;
   my $donesize = 0;
   my %tlpsizes;
+  debug("TLUtils::install_packages: fromtlpdb.root=$root, media=$media,"
+        . " totlpdb.root=" . $totlpdb->root
+        . " what=$what ($totalnr), opt_src=$opt_src, opt_doc=$opt_doc\n");
+
   foreach my $p (@packs) {
     $tlpobjs{$p} = $fromtlpdb->get_package($p);
     if (!defined($tlpobjs{$p})) {
@@ -1549,10 +1553,17 @@
       &$h($n,$totalnr);
     }
     # push $package to @packs_again if download failed
+    # (and not installing from disk).
     if (!$fromtlpdb->install_package($package, $totlpdb)) {
-      tlwarn("TLUtils::install_packages: Failed to install $package\n"
-             ."Will be retried later.\n");
-      push @packs_again, $package;
+      tlwarn("TLUtils::install_packages: Failed to install $package\n");
+      if ($media eq "NET") {
+        tlwarn("                           $package will be retried later.\n");
+        push @packs_again, $package;
+      } else {
+        # return false as soon as one package failed, since we won't
+        # be trying again.
+        return 0;
+      }
     } else {
       $donesize += $tlpsizes{$package};
     }
@@ -1988,7 +1999,7 @@
     return 0;
   }
   if (-w $to) {
-    debug ("linking files from $from to $to\n");
+    debug ("TLUtils::add_link_dir_dir: linking from $from to $to\n");
     chomp (@files = `ls "$from"`);
     my $ret = 1;
     for my $f (@files) {

Modified: trunk/Master/tlpkg/bin/tl-update-tlnet
===================================================================
--- trunk/Master/tlpkg/bin/tl-update-tlnet	2020-05-13 12:01:23 UTC (rev 55125)
+++ trunk/Master/tlpkg/bin/tl-update-tlnet	2020-05-13 17:27:10 UTC (rev 55126)
@@ -68,6 +68,7 @@
   mydir=`dirname $0`
   Master=`cd $mydir/../.. && pwd`
 fi
+prg=`basename $0`
 
 # If there are broken symlinks anywhere in the bin directories, give up
 # right away. The nightly cron checks that there no symlinks anywhere else.
@@ -78,8 +79,8 @@
 test -z "$tltrybase" \
 && tltrybase=`cd $tlweb/../.. && pwd`/tlnet-trial-`date +%y%m%d`
 tltry=$tltrybase/tlsrc.try
+echo "$0: Using tltry=$tltry"   # local working dir
 echo "$0: Using tlweb=$tlweb"   # top level network directory, mirrored
-echo "$0: Using tltry=$tltry"   # local working dir
 
 # Save current tlpdb in case of disaster.
 cp --force --backup $tlweb/tlpkg/texlive.tlpdb* /tmp
@@ -106,7 +107,7 @@
 
 # Update packages in our working dir.
 # These shell assignments have to come outside the cow-shell.
-echo "$0: Updating $tltry (from $Master) with cow-shell..."
+echo "$prg: Updating $tltry (from $Master) 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"
@@ -116,10 +117,10 @@
 #
 cd $tltry
 cow-shell <<END_COW
-echo "$0: Updating containers with (critical=$critical recreate=$recreate gpgcmd=$gpgcmd)"
-echo "$0:   $containers_invoke"
+echo "$prg: Updating containers with (critical=$critical recreate=$recreate gpgcmd=$gpgcmd)"
+echo "$prg:   $containers_invoke"
 if $containers_invoke; then :; else
-  echo "$0: tl-update-containers failed, goodbye." >&2
+  echo "$prg: tl-update-containers failed, goodbye." >&2
   exit 1
 fi
 
@@ -130,10 +131,10 @@
   # 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
   # tested.  Hopefully we don't break the Perl modules very often.
-  echo "$0: Updating install pkg with"
-  echo "$0:   $update_install_invoke"
+  echo "$prg: Updating install pkg with"
+  echo "$prg:   $update_install_invoke"
   if $update_install_invoke; then :; else
-    echo "$0: tl-update-install-pkg failed, goodbye." >&2
+    echo "$prg: tl-update-install-pkg failed, goodbye." >&2
     exit 1
   fi
 else
@@ -157,10 +158,9 @@
 zcat $tltry/install-tl-unx.tar.gz | tar -xf -
 cd install-tl-*  # subdir is YYYYMMDD
 
-# create TL install profile. We set TEXMFCACHE for the sake of
-# luaotfload-tool, although it should fall back to TEXMFVAR,
-# which is possibly used by nothing else.
-echo "# texlive-profile from $0
+# create test TL install profile.
+# We set TEXMFVAR for the sake of luaotfload-tool.
+echo "# texlive-profile from $0 `date`
 selected_scheme scheme-$scheme
 TEXDIR $tltryinst/$yyyy
 TEXMFLOCAL $tltryinst/texmf-local
@@ -186,10 +186,12 @@
 PATH=/usr/bin
 
 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 \
-  || true # install-tl can fail, but we test the output, so don't abort.
+tlnet_install_cmd="install-tl -location $tltry -profile texlive.profile"
+echo "$prg: Running test install (log: $tlnet_install_log)..."
+echo "$prg:   (in `pwd`)"
+echo "$prg:   $tlnet_install_cmd"
+perl $tlnet_install_cmd >$tlnet_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.
@@ -243,10 +245,10 @@
 if test -n "$unexpected_output"; then
   $ignore_unexpected_output || failure=true
   echo >&2
-  echo "$0: Test installation failed." >&2
-  echo "$0: Here is the unexpected output, from $tlnet_install_log:" >&2
+  echo "$prg: Test installation failed." >&2
+  echo "$prg: Here is the unexpected output, from $tlnet_install_log:" >&2
   echo "$unexpected_output" >&2
-  echo "$0: (end of unexpected output)." >&2
+  echo "$prg: (end of unexpected output)." >&2
 fi
 
 # more consistency checks.
@@ -265,10 +267,10 @@
       $check_consistency || continue
     fi
     basecmd=`basename $cmdname`
-    echo "$0: Running $basecmd ($cmd)"
+    echo "$prg: Running $basecmd ($cmd)"
     outfile=/tmp/tlnet.$basecmd
     if $cmd >$outfile 2>&1; then :; else
-      echo "$0: $basecmd failed ($cmd):" >&2
+      echo "$prg: $basecmd failed ($cmd):" >&2
       sed 8q $outfile >&2
       echo "... see $outfile for full output ..." >&2
       echo >&2
@@ -284,7 +286,7 @@
 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
+  echo "$prg: seems fmtutil failed, check $install_tl_log." >&2
   failure=true
 else
   : # appease -e
@@ -297,18 +299,18 @@
 
 if $failure || $chicken; then
   echo >&2
-  echo "$0: Our transcript file: $tlnet_install_log" >&2
-  echo "$0: install-tl log file: $install_tl_log" >&2
-  echo "$0: Copies of both are in /tmp." >&2
-  echo "$0: Please rm -rf the trial dir." >&2
+  echo "$prg: Our transcript file: $tlnet_install_log" >&2
+  echo "$prg: install-tl log file: $install_tl_log" >&2
+  echo "$prg: Copies of both are in /tmp." >&2
+  echo "$prg: Please rm -rf the trial dir." >&2
   if $failure; then
     exit 1
   elif $chicken; then
     echo
-    echo "$0: Chicken mode, not updating anything."
+    echo "$prg: Chicken mode, not updating anything."
     exit 0
   else
-    echo "$0: impossible non-failure non-chicken." >&2
+    echo "$prg: impossible non-failure non-chicken." >&2
     exit 2
   fi
 fi
@@ -316,7 +318,7 @@
 # 

 # no unexpected output, so ship the new packages.
 cd $tltrybase
-echo "$0: Updating $tlweb from $tltry."
+echo "$prg: Updating $tlweb from $tltry."
 # copy any mactex files since we didn't link them.
 for f in $tlweb/*mactex*; do
   test ! -r $f || cp -pf $f $tltry



More information about the tex-live-commits mailing list.