diff options
author | Karl Berry <karl@freefriends.org> | 2023-10-09 22:06:02 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2023-10-09 22:06:02 +0000 |
commit | 2a54cd16b3ca7fd66238cd6b07ceb41e7f824550 (patch) | |
tree | c5123043ac69baa323f5e99b57d8c512d0a09cc3 /Master/tlpkg | |
parent | 7c7eee62f2c521eedb6522e39e430f9ed69b303a (diff) |
(equal_hashes): avoid now-deprecated smartmatch.
Also eliminate special case of ignoring the "date" field,
since we removed catalogue-date from tlpdb quite a
while ago. Fingers crossed.
git-svn-id: svn://tug.org/texlive/trunk@68496 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/tlpkg')
-rwxr-xr-x | Master/tlpkg/bin/tl-update-tlpdb | 23 |
1 files changed, 9 insertions, 14 deletions
diff --git a/Master/tlpkg/bin/tl-update-tlpdb b/Master/tlpkg/bin/tl-update-tlpdb index 433c4bce13b..056c8ab5d60 100755 --- a/Master/tlpkg/bin/tl-update-tlpdb +++ b/Master/tlpkg/bin/tl-update-tlpdb @@ -12,7 +12,6 @@ BEGIN { } use strict; use warnings; -use experimental qw(smartmatch); # what the heck, see ~~ below use TeXLive::TLConfig; use TeXLive::TLPSRC; @@ -641,7 +640,7 @@ sub suredef { sub equal_hashes { my ($h1,$h2) = @_; - # if neither is defined, that's ok. + # if both are undef, that's ok. return 1 if !defined $h1 && !defined $h2; # both must be hash references. @@ -650,24 +649,12 @@ sub equal_hashes { return 0; } - # must have the same keys (smartmatch operator). - if (! (%$h1 ~~ %$h2)) { - debug(" keys not equal:", join("|", keys %$h1), " vs. ", - join("|", keys %$h2), "\n"); - return 0; - } - # if they have no keys, they are the same (we won't go through the loop). my $ret = (keys %$h1 == 0); # for my $k (keys %$h1) { #debug(" checking key $k\n"); - # ignore catalogue-date differences. We will eliminate the field - # entirely at some point, but there are so many packages that differ - # only in catalogue-date, no need to do it all at once. - next if $k eq "date"; - my $aval = $h1->{$k}; my $bval = $h2->{$k}; @@ -693,6 +680,14 @@ sub equal_hashes { last if $ret == 0; # as soon as something is not equal, we're done } + # check that h2 doesn't have any keys besides those in h1. + for my $k (keys %$h2) { + next if exists $h1->{$k}; + ddebug(" key $k exists in h2 but not h1\n"); + $ret = 0; + last; + } + #debug("equal_hashes returns: $ret\n"); return $ret; } |