texlive[68818] Master/texmf-dist/scripts/texlive/tlmgr.pl: tlmgr:

commits+preining at tug.org commits+preining at tug.org
Sun Nov 12 01:30:53 CET 2023


Revision: 68818
          https://tug.org/svn/texlive?view=revision&revision=68818
Author:   preining
Date:     2023-11-12 01:30:53 +0100 (Sun, 12 Nov 2023)
Log Message:
-----------
tlmgr: check for out-of-sync remote tlpdb

In case the remote tlpdb is older than the last seen/used one,
bail out. This can happen when mirrors are not in sync, and
the CTAN multiplexer is used. This can lead to forcibly removed
packages:
- the multiplexer returned different servers in the two calls
- the second mirror was still not synced and showed the db from before
  the new packages were introduced
- tlmgr checks for "auto-removal" by looking at the collections and
  their respective dependencies (== packages), and if one package is
  available in the local version of the collection, but not in the
  remote one, then it will be tagged as auto-removal

We use texlive-scripts to determine an approximation of last seen
remote revision, since texlive-scripts is updated practically every
day. Alternative approaches are documented in the code.

Modified Paths:
--------------
    trunk/Master/texmf-dist/scripts/texlive/tlmgr.pl

Modified: trunk/Master/texmf-dist/scripts/texlive/tlmgr.pl
===================================================================
--- trunk/Master/texmf-dist/scripts/texlive/tlmgr.pl	2023-11-11 22:43:59 UTC (rev 68817)
+++ trunk/Master/texmf-dist/scripts/texlive/tlmgr.pl	2023-11-12 00:30:53 UTC (rev 68818)
@@ -7340,6 +7340,32 @@
     }
   }
 
+  # check for remote main db being *older* than what we have seen before
+  # The check we employ is heuristic: texlive-scripts is updated practically
+  # every day. We compare the locally installed texlive-scripts with the
+  # remove revision, and if that does not line up, we error out.
+  # Alternative approaches
+  # - loop over all installed packages and take the maximum of the found revisions
+  # - on every update, save the last seen remote main revision into 00texlive.installation
+  #
+  if ($is_main) {
+    my $remote_revision = $remotetlpdb->config_revision;
+    my $tlp = $localtlpdb->get_package("texlive-scripts");
+    my $local_revision;
+    if (!defined($tlp)) {
+      info("texlive-scripts not found, not doing revision consistency check\n");
+      $local_revision = 0;
+    } else {
+      $local_revision = $tlp->revision;
+    }
+    if ($local_revision > $remote_revision) {
+      info("fail load $location\n") if ($::machinereadable);
+      return(undef, "Remote database (rev $remote_revision) seems to be older than local (rev $local_revision), please use different mirror or wait a bit.")
+    } else {
+      debug("Remote database revision $remote_revision, texlive-scripts local revision $local_revision\n");
+    }
+  }
+
   # check for being frozen
   if ($remotetlpdb->config_frozen) {
     my $frozen_msg = <<FROZEN;



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