texlive[64651] Master/tlpkg/bin/tl-update-tlpdb: correct sense of

commits+karl at tug.org commits+karl at tug.org
Sat Oct 8 18:49:53 CEST 2022


Revision: 64651
          http://tug.org/svn/texlive?view=revision&revision=64651
Author:   karl
Date:     2022-10-08 18:49:53 +0200 (Sat, 08 Oct 2022)
Log Message:
-----------
correct sense of comparisons of Catalogue data.

New option --commit-max (default 100) to avoid
committing the whole world in case of bugs.
(Seems we dodged a bullet there.)

Modified Paths:
--------------
    trunk/Master/tlpkg/bin/tl-update-tlpdb

Modified: trunk/Master/tlpkg/bin/tl-update-tlpdb
===================================================================
--- trunk/Master/tlpkg/bin/tl-update-tlpdb	2022-10-08 14:19:02 UTC (rev 64650)
+++ trunk/Master/tlpkg/bin/tl-update-tlpdb	2022-10-08 16:49:53 UTC (rev 64651)
@@ -28,6 +28,7 @@
 my $opt_catalogue = "";
 my $opt_catalogue_compare = "";
 my $opt_catalogue_dump = "";
+my $opt_commit_max = 100;
 my $opt_dry_run = 0;
 my $opt_fix_reverse_revisions = 0;  # needs svn commit
 my $opt_fromfiles = 0;
@@ -49,6 +50,7 @@
     "catalogue=s"                => \$opt_catalogue,
     "catalogue-compare=s"        => \$opt_catalogue_compare,
     "catalogue-dump=s"           => \$opt_catalogue_dump,
+    "commit-max=i"               => \$opt_commit_max,
     "dry-run|n",                 => \$opt_dry_run,
     "fix-reverse-revisions!"     => \$opt_fix_reverse_revisions,
     "from-files"                 => \$opt_fromfiles,
@@ -344,6 +346,16 @@
     }
   }
 
+  if (@svn_changed_files > $opt_commit_max) {
+    tlwarn(<<TOO_MUCH_CHANGED);
+$prg: more than $opt_commit_max files have been changed ($#svn_changed_files+1).
+This probably means a bug. Forcing --no-commit.
+
+If it's actually correct, rerun and set --commit-max=999 (or whatever
+value); probably easiest to do by editing cron.tl and rerunning.
+TOO_MUCH_CHANGED
+    $opt_no_commit = 1;
+  }
   if ($opt_no_commit) {
     if ($do_commit) {
       tlwarn("$prg: tlpsrc files have been changed but not committed.\n");
@@ -578,19 +590,19 @@
   
   # The shortdesc and longdesc usually come from the Catalogue,
   # but sometimes are in the tlpsrc.
-  if (! &suredef($tlpA->shortdesc) ne &suredef($tlpB->shortdesc)) {
+  if (! &suredef($tlpA->shortdesc) eq &suredef($tlpB->shortdesc)) {
     # Maybe someday combine this silly code to avoid redundancy,
     # and show strings (hashes) for all.
     debug("$pkg:  shortdesc now: ", &suredef($tlpA->shortdesc), "\n",
           " " x length($pkg),
-            "    vs. compare db:", &suredef($tlpB->shortdesc), "\n");
+            "    vs. compare db: ", &suredef($tlpB->shortdesc), "\n");
     
-  } elsif (! &suredef($tlpA->longdesc) ne &suredef($tlpB->longdesc)) {
+  } elsif (! &suredef($tlpA->longdesc) eq &suredef($tlpB->longdesc)) {
     debug("$pkg:  longdesc now: ", &suredef($tlpA->longdesc), "\n",
           " " x length($pkg),
             "   vs. compare db: ", &suredef($tlpB->longdesc), "\n");
 
-  } elsif (! &suredef($tlpA->catalogue) ne &suredef($tlpB->catalogue)) {
+  } elsif (! &suredef($tlpA->catalogue) eq &suredef($tlpB->catalogue)) {
     debug("$pkg: catalogue value changed (", &suredef($tlpA->catalogue),
           " -> ", &suredef($tlpB->catalogue), ")\n");
 
@@ -675,7 +687,7 @@
       $ret = &is_hash_ref($bval) ? &equal_hashes($aval, $bval) : 0;
     } else {
       # we don't have arrays, non-strings, etc., so this is enough.
-      $ret = &equal_strings($aval, $bval);
+      $ret = &suredef($aval) eq &suredef($bval);
     }
 
     last if $ret == 0; # as soon as something is not equal, we're done
@@ -763,6 +775,15 @@
 reading routines (L<TeXLive::TeXCatalogue>), since they won't get
 invoked at all if the dump is read.
 
+=item B<--commit-max> I<integer>
+
+If more than I<integer> files have been changed, do not do any commits
+(like C<--no-commit>). The default is 100; that is, if more than 100
+files have been changed, the commit will not be done and a warning
+issued. If by some strange chance more than 100 files actually need to
+be committed, can override with this option (probably by editing
+C<cron.tl>).
+
 =item B<--fix-reverse-revisions>
 
 If a package with revision number going backward is found, this option



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