texlive[53112] Master/tlpkg: * TLPOBJ.pm (writeout): do not write

commits+karl at tug.org commits+karl at tug.org
Fri Dec 13 00:43:12 CET 2019


Revision: 53112
          http://tug.org/svn/texlive?view=revision&revision=53112
Author:   karl
Date:     2019-12-13 00:43:12 +0100 (Fri, 13 Dec 2019)
Log Message:
-----------
* TLPOBJ.pm (writeout): do not write catalogue-date.
(update_from_catalogue): do not insert {date} into cataloguedata hash.
* tl-update-tlpdb (equal_hashes): ignore differences in catalogue-date.

The idea is that we will no longer have catalogue-date in the
development tlpdb; updated packages in tlnet will thus have it omitted.
We'll remove it entirely from tlnet packages at some point in the
future, but no need to rush.

This is all because the date value is not meaningful; it's the time of
the last commit to the Catalogue subversion repository, which is often
entirely unrelated to an update to the package itself. Since we will no
longer recreate all packages for each year's release, we have to sync
the Catalogue information at other times, so omitting useless updates
will be all to the good.

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

Modified: trunk/Master/tlpkg/TeXLive/TLPOBJ.pm
===================================================================
--- trunk/Master/tlpkg/TeXLive/TLPOBJ.pm	2019-12-12 23:22:05 UTC (rev 53111)
+++ trunk/Master/tlpkg/TeXLive/TLPOBJ.pm	2019-12-12 23:43:12 UTC (rev 53112)
@@ -370,6 +370,7 @@
   }
   # writeout all the catalogue keys
   foreach my $k (sort keys %{$self->cataloguedata}) {
+    next if $k eq "date";
     print $fd "catalogue-$k ", $self->cataloguedata->{$k}, "\n";
   }
 }
@@ -845,21 +846,10 @@
   $tlcname = lc($tlcname);
   if (defined($tlc->entries->{$tlcname})) {
     my $entry = $tlc->entries->{$tlcname};
-    # Record the id of the catalogue entry if it's found due to 
-    # quest4texlive.
+    # Record the id of the catalogue entry if it's found.
     if ($entry->entry->{'id'} ne $tlcname) {
       $self->catalogue($entry->entry->{'id'});
     }
-    if (defined($entry->entry->{'date'})) {
-      my $foo = $entry->entry->{'date'};
-      $foo =~ s/^.Date: //;
-      # trying to extract the interesting part of a subversion date
-      # keyword expansion here, e.g.,
-      # <dollar>Date: 2007-08-15 19:43:35 +0100 (Wed, 27 Nov 2019) <dollar>
-      # ->2007-08-15 19:43:35 +0100
-      $foo =~ s/ \(.*\)( *\$ *)$//;  # maybe nothing after parens
-      $self->cataloguedata->{'date'} = $foo;
-    }
     if (defined($entry->license)) {
       $self->cataloguedata->{'license'} = $entry->license;
     }

Modified: trunk/Master/tlpkg/bin/tl-update-tlpdb
===================================================================
--- trunk/Master/tlpkg/bin/tl-update-tlpdb	2019-12-12 23:22:05 UTC (rev 53111)
+++ trunk/Master/tlpkg/bin/tl-update-tlpdb	2019-12-12 23:43:12 UTC (rev 53112)
@@ -515,8 +515,8 @@
     
     next unless defined $tlpA && defined $tlpB;
     
-    # The Master tree isn't relocatable, but for the comparison (tlnet)
-    # tree, must swap RELOC marker for actual tree so we can compare.
+    # The Master tree isn't relocatable, so for the comparison (tlnet) tree,
+    # must swap RELOC marker for actual tree so we can compare strings.
     $tlpB->replace_reloc_prefix();
     
     if (! &tlpobj_catalogue_equal($tlpA, $tlpB)) {
@@ -589,13 +589,13 @@
   return 1 if !defined $h1 && !defined $h2;
   
   # both must be hash references.
-  if (! (&is_hash_ref($h1) && is_hash_ref($h2))) {
+  if (! (&is_hash_ref($h1) && &is_hash_ref($h2))) {
     ddebug(" not both hash ref: $h1 vs. $h2\n");
     return 0;
   }
 
   # must have the same keys (smartmatch operator).
-  if (! %$h1 ~~ %$h2) {
+  if (! (%$h1 ~~ %$h2)) {
     ddebug(" keys not equal:", join("|", keys %$h1), " vs. ",
            join("|", keys %$h2), "\n");
     return 0;
@@ -606,6 +606,12 @@
   #
   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};
     
@@ -612,6 +618,7 @@
     if (!defined $aval && !defined $bval) {
       # ok if both are undefined.
       $ret = 1;
+      next;
     } else {
       # else both have to be defined.
       #debug("  for $k, aval=$aval, bval=$bval\n");
@@ -623,11 +630,11 @@
       # if both are hashes compare, else must be not equal.
       $ret = &is_hash_ref($bval) ? &equal_hashes($aval, $bval) : 0;
     } else {
-      # we don't have arrays, non-strings, etc., so don't implement.
+      # we don't have arrays, non-strings, etc., so this is enough.
       $ret = &equal_strings($aval, $bval);
     }
 
-    last if $ret == 0;
+    last if $ret == 0; # as soon as something is not equal, we're done
   }
   
   #debug("equal_hashes returns: $ret\n");
@@ -683,9 +690,10 @@
 
 By default, packages for which the only change is in the Catalogue data
 are not marked as updated and written with new revisions. This option
-changes that. We enable this for major releases. This implies
-C<--reverse-revision-check>, since the same mechanism is used to force
-the new version numbers.
+changes that (except that the catalogue-date field is ignored). We
+enable this from time to time to re-sync package information. This
+implies C<--reverse-revision-check>, since the same mechanism is used to
+force the new version numbers.
 
 =item B<--fix-reverse-revisions>
 



More information about the tex-live-commits mailing list