texlive[56565] Master/tlpkg: try detecting changes in fmttriggers

commits+preining at tug.org commits+preining at tug.org
Tue Oct 6 02:40:39 CEST 2020


Revision: 56565
          http://tug.org/svn/texlive?view=revision&revision=56565
Author:   preining
Date:     2020-10-06 02:40:39 +0200 (Tue, 06 Oct 2020)
Log Message:
-----------
try detecting changes in fmttriggers

Modified Paths:
--------------
    trunk/Master/tlpkg/TeXLive/TLUtils.pm
    trunk/Master/tlpkg/bin/tl-update-tlpdb

Modified: trunk/Master/tlpkg/TeXLive/TLUtils.pm
===================================================================
--- trunk/Master/tlpkg/TeXLive/TLUtils.pm	2020-10-05 23:53:47 UTC (rev 56564)
+++ trunk/Master/tlpkg/TeXLive/TLUtils.pm	2020-10-06 00:40:39 UTC (rev 56565)
@@ -4170,6 +4170,7 @@
   $ret{'revision'}  = "revA:revB" # if revisions differ
   $ret{'removed'}   = \[ list of files removed from A to B ]
   $ret{'added'}     = \[ list of files added from A to B ]
+  $ret{'fmttriggers'} = 1 if the fmttriggers have changed
 
 =cut
 
@@ -4200,6 +4201,51 @@
   $ret{'removed'} = \@rem if @rem;
   $ret{'added'} = \@add if @add;
 
+  # changed dependencies should not trigger a change without a
+  # change in revision, so for now (until we find a reason why
+  # we need to) we don't check.
+  # OTOH, execute statements like
+  #   execute AddFormat name=aleph engine=aleph options=*aleph.ini fmttriggers=cm,hyphen-base,knuth-lib,plain
+  # might change due to changes in the fmttriggers variables.
+  # Again, name/engine/options are only defined in the package's
+  # tlpsrc file, so changes here will trigger revision changes,
+  # but fmttriggers are defined outside the tlpsrc and thus do
+  # not trigger an automatic revision change. Check for that!
+  # No need to record actual changes, just record that it has changed.
+  my %triggersA;
+  my %triggersB;
+  # we sort executes after format/engine like fmtutil does, since this
+  # should be unique
+  for my $e ($tlpA->executes) {
+    if ($e =~ m/AddFormat\s+(.*)\s*/) {
+      my %r = parse_AddFormat_line("$1");
+      if (defined($r{"error"})) {
+        die "$r{'error'} when comparing packages $tlpA->name execute $e";
+      }
+      for my $t (@{$r{'fmttriggers'}}) {
+        $triggersA{"$r{'name'}:$r{'engine'}:$t"} = 1;
+      }
+    }
+  }
+  for my $e ($tlpB->executes) {
+    if ($e =~ m/AddFormat\s+(.*)\s*/) {
+      my %r = parse_AddFormat_line("$1");
+      if (defined($r{"error"})) {
+        die "$r{'error'} when comparing packages $tlpB->name execute $e";
+      }
+      for my $t (@{$r{'fmttriggers'}}) {
+        $triggersB{"$r{'name'}:$r{'engine'}:$t"} = 1;
+      }
+    }
+  }
+  for my $t (keys %triggersA) {
+    delete($triggersA{$t});
+    delete($triggersB{$t});
+  }
+  if (keys(%triggersA) || keys(%triggersB)) {
+    $ret{'fmttrigger'} = 1;
+  }
+
   return %ret;
 }
 

Modified: trunk/Master/tlpkg/bin/tl-update-tlpdb
===================================================================
--- trunk/Master/tlpkg/bin/tl-update-tlpdb	2020-10-05 23:53:47 UTC (rev 56564)
+++ trunk/Master/tlpkg/bin/tl-update-tlpdb	2020-10-06 00:40:39 UTC (rev 56565)
@@ -254,10 +254,11 @@
   if (exists $cmp{'different_packages'}) {
     for my $p (sort keys %{$cmp{'different_packages'}}) {
       if (defined($cmp{'different_packages'}->{$p}->{'added'}) ||
-          defined($cmp{'different_packages'}->{$p}->{'removed'})) {
+          defined($cmp{'different_packages'}->{$p}->{'removed'}) ||
+          defined($cmp{'different_packages'}->{$p}->{'fmttrigger'})) {
         if (!defined($cmp{'different_packages'}->{$p}->{'revision'})) {
-          # no revision change reported, but files have been added
-          # or removed, try fixing it
+          # no revision change reported, but files or fmttriggers have
+          # been added or removed, try fixing it
           $packages_needing_fixup{$p} = 1;
         } else {
           # revision change has been reported, if the revision is increasing



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