texlive[66236] Master: run mtxrun --generate and context --luatex

commits+karl at tug.org commits+karl at tug.org
Mon Feb 27 22:44:33 CET 2023


Revision: 66236
          http://tug.org/svn/texlive?view=revision&revision=66236
Author:   karl
Date:     2023-02-27 22:44:33 +0100 (Mon, 27 Feb 2023)
Log Message:
-----------
run mtxrun --generate and context --luatex --generate as post-install actions, only if the luametatex binary is operational

Modified Paths:
--------------
    trunk/Master/install-tl
    trunk/Master/texmf-dist/scripts/texlive/NEWS
    trunk/Master/texmf-dist/scripts/texlive/tlmgr.pl
    trunk/Master/tlpkg/TeXLive/TLUtils.pm

Modified: trunk/Master/install-tl
===================================================================
--- trunk/Master/install-tl	2023-02-27 21:09:11 UTC (rev 66235)
+++ trunk/Master/install-tl	2023-02-27 21:44:33 UTC (rev 66236)
@@ -1349,14 +1349,22 @@
     }
   }
 
-  # luatex/context setup.
+  # lmtx/context setup. The story here is that in 2023, the lmtx binary
+  # for x86_64-linux was too new to run on the system where we build TL.
+  # (luametatex: /lib64/libm.so.6: version `GLIBC_2.23' not found)
+  # So we have to try running it to see it succeeds, not just test for 
+  # the program's existence. And since it exits nonzero given no args,
+  # we have to specify --version. Hope it keeps working like that ...
+  my $lmtx = "$plat_bindir/luametatex$progext";
   if (exists($install{"context"}) && $install{"context"} == 1
-      && -x "$plat_bindir/luametatex$progext"
-      && !exists $ENV{"TEXLIVE_INSTALL_NO_CONTEXT_CACHE"}) {
-; # x86_64-linux binary too new
-#    info("setting up ConTeXt cache: ");
-#    $errcount += run_postinst_cmd("mtxrun --generate");
-#    $errcount += run_postinst_cmd("context --luatex --generate");
+      && !exists $ENV{"TEXLIVE_INSTALL_NO_CONTEXT_CACHE"}
+      && TeXLive::TLUtils::system_ok("$lmtx --version")
+     ) {
+    info("setting up ConTeXt cache: ");
+    $errcount += run_postinst_cmd("mtxrun --generate");
+    $errcount += run_postinst_cmd("context --luatex --generate");
+  } else {
+    debug("skipped ConTeXt cache setup\n");
   }
 
   # all formats option

Modified: trunk/Master/texmf-dist/scripts/texlive/NEWS
===================================================================
--- trunk/Master/texmf-dist/scripts/texlive/NEWS	2023-02-27 21:09:11 UTC (rev 66235)
+++ trunk/Master/texmf-dist/scripts/texlive/NEWS	2023-02-27 21:44:33 UTC (rev 66236)
@@ -1,6 +1,10 @@
 (This file public domain.  Originally written by Norbert Preining and
 Karl Berry, 2010.)
 
+<p><b>tlmgr 66236 (released 28feb23):</b>
+<li>run both mtxrun --generate and context --luatex --generate
+as post-update actions, if the luametatex binary is operational.
+
 <p><b>tlmgr 66218 (released 27feb23):</b>
 <li>rename "path --w32mode" option to --windowsmode; similar throughout.
 

Modified: trunk/Master/texmf-dist/scripts/texlive/tlmgr.pl
===================================================================
--- trunk/Master/texmf-dist/scripts/texlive/tlmgr.pl	2023-02-27 21:09:11 UTC (rev 66235)
+++ trunk/Master/texmf-dist/scripts/texlive/tlmgr.pl	2023-02-27 21:44:33 UTC (rev 66236)
@@ -892,11 +892,16 @@
 
   if ($::files_changed) {
     $errors += do_cmd_and_check("mktexlsr");
+    # see comments in install-tl about lmtx.
+    my $lmtx = "$bindir/luametatex";
     if (defined($localtlpdb->get_package('context'))
-	    && (-x "$bindir/luametatex" || -x "$bindir/luametatex.exe")) {
-; # x86_64-linux binary too new
-#      $errors += do_cmd_and_check("mtxrun --generate");
-#      $errors += do_cmd_and_check("context --luatex --generate");
+        && (-x "$lmtx" || -x "$lmtx.exe")
+        && TeXLive::TLUtils::system_ok("$lmtx --version")
+       ) {
+      $errors += do_cmd_and_check("mtxrun --generate");
+      $errors += do_cmd_and_check("context --luatex --generate");
+    } else {
+      debug("skipped ConTeXt cache regeneration\n");
     }
     $::files_changed = 0;
   }

Modified: trunk/Master/tlpkg/TeXLive/TLUtils.pm
===================================================================
--- trunk/Master/tlpkg/TeXLive/TLUtils.pm	2023-02-27 21:09:11 UTC (rev 66235)
+++ trunk/Master/tlpkg/TeXLive/TLUtils.pm	2023-02-27 21:44:33 UTC (rev 66236)
@@ -106,12 +106,6 @@
   TeXLive::TLUtils::member($item, @list);
   TeXLive::TLUtils::merge_into(\%to, \%from);
   TeXLive::TLUtils::texdir_check($texdir);
-  TeXLive::TLUtils::quotify_path_with_spaces($path);
-  TeXLive::TLUtils::conv_to_w32_path($path);
-  TeXLive::TLUtils::native_slashify($internal_path);
-  TeXLive::TLUtils::forward_slashify($path_from_user);
-  TeXLive::TLUtils::give_ctan_mirror();
-  TeXLive::TLUtils::give_ctan_mirror_base();
   TeXLive::TLUtils::compare_tlpobjs($tlpA, $tlpB);
   TeXLive::TLUtils::compare_tlpdbs($tlpdbA, $tlpdbB);
   TeXLive::TLUtils::report_tlpdb_differences(\%ret);
@@ -121,6 +115,18 @@
   TeXLive::TLUtils::prepend_own_path();
   TeXLive::TLUtils::repository_to_array($str);
 
+=head2 Windows and paths
+
+  TeXLive::TLUtils::quotify_path_with_spaces($path);
+  TeXLive::TLUtils::conv_to_w32_path($path);
+  TeXLive::TLUtils::native_slashify($internal_path);
+  TeXLive::TLUtils::forward_slashify($path_from_user);
+
+=head2 CTAN
+
+  TeXLive::TLUtils::give_ctan_mirror();
+  TeXLive::TLUtils::give_ctan_mirror_base();
+
 =head2 JSON
 
   TeXLive::TLUtils::encode_json($ref);
@@ -232,6 +238,7 @@
     &give_ctan_mirror_base
     &create_mirror_list
     &extract_mirror_entry
+    &system_ok
     &wsystem
     &xsystem
     &run_cmd
@@ -704,7 +711,19 @@
   ddebug("xchdir($dir) ok\n");
 }
 
+=item C<system_ok($cmdline)>
 
+Run C<system($cmdline)> and return true if return status was zero, false
+if status was nonzero. Throw away stdout and stderr.
+
+=cut
+
+sub system_ok {
+  my ($cmdline) = @_;
+  `$cmdline >/dev/null 2>&1`;
+  return $? == 0;
+}
+
 =item C<wsystem($msg, @args)>
 
 Call C<info> about what is being done starting with C<$msg>, then run



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