summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNorbert Preining <preining@logic.at>2020-10-06 00:40:39 +0000
committerNorbert Preining <preining@logic.at>2020-10-06 00:40:39 +0000
commit2470521c5ea9ceb224b1911d86836f389bbdfa4d (patch)
treedd6e655f75ba22e1cb6046356c6e631ed913202c
parent73b3b3a6d35435c5bf55001e45da09ec18928343 (diff)
try detecting changes in fmttriggers
git-svn-id: svn://tug.org/texlive/trunk@56565 c570f23f-e606-0410-a88d-b1316a301751
-rw-r--r--Master/tlpkg/TeXLive/TLUtils.pm46
-rwxr-xr-xMaster/tlpkg/bin/tl-update-tlpdb7
2 files changed, 50 insertions, 3 deletions
diff --git a/Master/tlpkg/TeXLive/TLUtils.pm b/Master/tlpkg/TeXLive/TLUtils.pm
index dfec74f6fd9..c1810a76a6f 100644
--- a/Master/tlpkg/TeXLive/TLUtils.pm
+++ b/Master/tlpkg/TeXLive/TLUtils.pm
@@ -4170,6 +4170,7 @@ Compare the two passed L<TLPOBJ> objects. Returns a hash:
$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 @@ sub compare_tlpobjs {
$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;
}
diff --git a/Master/tlpkg/bin/tl-update-tlpdb b/Master/tlpkg/bin/tl-update-tlpdb
index 18ad22ab247..954fb73c114 100755
--- a/Master/tlpkg/bin/tl-update-tlpdb
+++ b/Master/tlpkg/bin/tl-update-tlpdb
@@ -254,10 +254,11 @@ sub compare_and_fix_tlpdbs {
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