diff options
author | Norbert Preining <norbert@preining.info> | 2019-10-02 12:33:27 +0900 |
---|---|---|
committer | Norbert Preining <norbert@preining.info> | 2019-10-02 12:33:50 +0900 |
commit | 42d23ac5aebb2ff46917ba7f80226c121c4ccba8 (patch) | |
tree | a480c706ab489cac34d05b34f597fc550d18dc32 /Master | |
parent | a81740dbc6000c7523cee4b164a1a410535be3d1 (diff) |
allow updating revision when catalogue data changeddev/versioned-containers
Diffstat (limited to 'Master')
-rw-r--r-- | Master/tlpkg/TeXLive/TLUtils.pm | 27 | ||||
-rwxr-xr-x | Master/tlpkg/bin/tl-update-tlpdb | 12 |
2 files changed, 39 insertions, 0 deletions
diff --git a/Master/tlpkg/TeXLive/TLUtils.pm b/Master/tlpkg/TeXLive/TLUtils.pm index e7aef738ec0..5e2ef2e565c 100644 --- a/Master/tlpkg/TeXLive/TLUtils.pm +++ b/Master/tlpkg/TeXLive/TLUtils.pm @@ -3948,6 +3948,8 @@ sub download_to_temp_or_file { # $ret{'revision'} = "leftRev:rightRev" if revision differ # $ret{'removed'} = \[ list of files removed from A to B ] # $ret{'added'} = \[ list of files added from A to B ] +# $ret{'catalogue'} = 1 if catalogue data has changed +# but we don't do any semantic check of catalogue data # sub compare_tlpobjs { my ($tlpA, $tlpB) = @_; @@ -3977,6 +3979,31 @@ sub compare_tlpobjs { @add = sort keys %added; $ret{'removed'} = \@rem if @rem; $ret{'added'} = \@add if @add; + # check on difference in catalogue data with respect to keys and values + my $catAname = $tlpA->catalogue; + my $catBname = $tlpB->catalogue; + my $catA = $tlpA->cataloguedata; + my $catB = $tlpB->cataloguedata; + my $catChanges = 0; + if ($catAname ne $catBname) { + $catChanges = 1; + } else { + for my $k (keys %$catA) { + if (!$catB->{$k} || $catA->{$k} ne $catB->{$k}) { + $catChanges = 1; + last; + } + } + if (!$catChanges) { + for my $k (keys %$catB) { + if (!$catA->{$k} || $catA->{$k} ne $catB->{$k}) { + $catChanges = 1; + last; + } + } + } + } + $ret{'catalogue'} = $catChanges; return %ret; } diff --git a/Master/tlpkg/bin/tl-update-tlpdb b/Master/tlpkg/bin/tl-update-tlpdb index a43baa6e08e..4c71cb78bcc 100755 --- a/Master/tlpkg/bin/tl-update-tlpdb +++ b/Master/tlpkg/bin/tl-update-tlpdb @@ -41,6 +41,7 @@ my $opt_save_anyway = 0; my $opt_tlpsrc_from_cmdline = 0; my $opt_w32warning; my $opt_keep_revisions = 0; +my $opt_cat_updates_tlpdb = 0; TeXLive::TLUtils::process_logging_options(); GetOptions( @@ -59,6 +60,7 @@ GetOptions( "save-anyway!" => \$opt_save_anyway, "tlpsrc-from-cmdline" => \$opt_tlpsrc_from_cmdline, "with-w32-pattern-warning" => \$opt_w32warning, + "cat-updates-tlpdb" => \$opt_cat_updates_tlpdb, "help|?" => \$help) or pod2usage(1); pod2usage(-exitstatus => 0, -verbose => 2) if $help; @@ -222,11 +224,21 @@ sub compare_and_fix_tlpdbs { # that is fine, otherwise try fixing it my ($rA, $rB) = split (':', $ret{'different_packages'}->{$p}->{'revision'}); + # since we only register 'revision' key when there is a change, we have + # either rA < rB or rA > rB if ($rA > $rB) { tlwarn("$progname: big warning for $p: file lists didn't change but " . "revision is going backward! Very strange!\n"); $packages_that_need_fixup{$p} = 1; } + } else { + # no revision change, so check catalogue + if (defined($ret{'different_packages'}->{$p}->{'catalogue'})) { + if ($opt_cat_updates_tlpdb) { + debug ("$progname: updating package $p due to catalogue changes and --cat-updates-tlpdb\n"); + $packages_that_need_fixup{$p} = 1; + } + } } } } |