texlive[64503] Master/tlpkg: tl-update-tlpdb (suredef): new fn,

commits+karl at tug.org commits+karl at tug.org
Sun Sep 25 18:50:19 CEST 2022


Revision: 64503
          http://tug.org/svn/texlive?view=revision&revision=64503
Author:   karl
Date:     2022-09-25 18:50:19 +0200 (Sun, 25 Sep 2022)
Log Message:
-----------
tl-update-tlpdb (suredef): new fn, replacing equal strings.
(tlpobj_catalogue_equal): use it to avoid dumb undef value warnings when
  printing values. Also, show tlp[AB]->catalogue values.

TLUtils.pm (debug, ddebug, dddebug): return immediately if verbosity < 1;
this may avoid unnecessary warnings when the arguments contain undef
(and is trivially faster).

This was occasioned by a warning from the --catalogue-compare run:
    Use of uninitialized value $_[5] in join or string at tlpkg/bin/../TeXLive/TLUtils.pm line 3715.
    D:bibtexu:  longdesc now: An enhanced, portable C version ...
              vs. compare db: 
With new packages, a tlp value in the old package may indeed be undef.

releng.txt: unrelated doc updates.

Modified Paths:
--------------
    trunk/Master/tlpkg/TeXLive/TLUtils.pm
    trunk/Master/tlpkg/bin/tl-update-tlpdb
    trunk/Master/tlpkg/doc/releng.txt

Modified: trunk/Master/tlpkg/TeXLive/TLUtils.pm
===================================================================
--- trunk/Master/tlpkg/TeXLive/TLUtils.pm	2022-09-25 15:03:22 UTC (rev 64502)
+++ trunk/Master/tlpkg/TeXLive/TLUtils.pm	2022-09-25 16:50:19 UTC (rev 64503)
@@ -146,10 +146,11 @@
   @::ddebug_hook = @::ddebug_hook;
   @::dddebug_hook = @::dddebug_hook;
   @::info_hook = @::info_hook;
+  @::install_packages_hook = @::install_packages_hook;
+  @::installation_failed_packages = @::installation_failed_packages;
   @::warn_hook = @::warn_hook;
   $::checksum_method = $::checksum_method;
   $::gui_mode = $::gui_mode;
-  @::install_packages_hook = @::install_packages_hook;
   $::machinereadable = $::machinereadable;
   $::no_execute_actions = $::no_execute_actions;
   $::regenerate_all_formats = $::regenerate_all_formats;
@@ -3712,8 +3713,8 @@
 =cut
 
 sub debug {
+  return if ($::opt_verbosity < 1);
   my $str = "D:" . join("", @_);
-  return if ($::opt_verbosity < 1);
   logit(\*STDERR, 1, $str);
   for my $i (@::debug_hook) {
     &{$i}($str);
@@ -3733,8 +3734,8 @@
 =cut
 
 sub ddebug {
+  return if ($::opt_verbosity < 2);
   my $str = "DD:" . join("", @_);
-  return if ($::opt_verbosity < 2);
   logit(\*STDERR, 2, $str);
   for my $i (@::ddebug_hook) {
     &{$i}($str);
@@ -3757,8 +3758,8 @@
 =cut
 
 sub dddebug {
+  return if ($::opt_verbosity < 3);
   my $str = "DDD:" . join("", @_);
-  return if ($::opt_verbosity < 3);
   logit(\*STDERR, 3, $str);
   for my $i (@::dddebug_hook) {
     &{$i}($str);

Modified: trunk/Master/tlpkg/bin/tl-update-tlpdb
===================================================================
--- trunk/Master/tlpkg/bin/tl-update-tlpdb	2022-09-25 15:03:22 UTC (rev 64502)
+++ trunk/Master/tlpkg/bin/tl-update-tlpdb	2022-09-25 16:50:19 UTC (rev 64503)
@@ -2,18 +2,16 @@
 # $Id$
 # Convert a TL tree and *.tlpsrc files into a (possibly updated) texlive.tlpdb.
 # 
-# Copyright 2007-2020 Norbert Preining
+# Copyright 2007-2022 Norbert Preining
 # This file is licensed under the GNU General Public License version 2
 # or any later version.
 
-#use warnings FATAL => 'all'; # can help in development
 BEGIN {
-  $^W = 1;
   chomp($mydir = `dirname $0`);
   unshift(@INC, "$mydir/..");
 }
 
-use strict;
+use strict; use warnings;
 use experimental qw(smartmatch); # what the heck, see ~~ below
 
 use TeXLive::TLConfig;
@@ -580,20 +578,21 @@
   
   # The shortdesc and longdesc usually come from the Catalogue,
   # but sometimes are in the tlpsrc.
-  if (! &equal_strings($tlpA->shortdesc, $tlpB->shortdesc)) {
+  if (! &suredef($tlpA->shortdesc) ne &suredef($tlpB->shortdesc)) {
     # Maybe someday combine this silly code to avoid redundancy,
     # and show strings (hashes) for all.
-    debug("$pkg:  shortdesc now: ", $tlpA->shortdesc, "\n",
+    debug("$pkg:  shortdesc now: ", &suredef($tlpA->shortdesc), "\n",
           " " x length($pkg),
-            "    vs. compare db:", $tlpB->shortdesc, "\n");
+            "    vs. compare db:", &suredef($tlpB->shortdesc), "\n");
     
-  } elsif (! &equal_strings($tlpA->longdesc, $tlpB->longdesc)) {
-    debug("$pkg:  longdesc now: ", $tlpA->longdesc, "\n",
+  } elsif (! &suredef($tlpA->longdesc) ne &suredef($tlpB->longdesc)) {
+    debug("$pkg:  longdesc now: ", &suredef($tlpA->longdesc), "\n",
           " " x length($pkg),
-            "   vs. compare db: ", $tlpB->longdesc, "\n");
+            "   vs. compare db: ", &suredef($tlpB->longdesc), "\n");
 
-  } elsif (! &equal_strings($tlpA->catalogue, $tlpB->catalogue)) {
-    debug("$pkg: catalogue value changed\n");
+  } elsif (! &suredef($tlpA->catalogue) ne &suredef($tlpB->catalogue)) {
+    debug("$pkg: catalogue value changed (", &suredef($tlpA->catalogue),
+          " -> ", &suredef($tlpB->catalogue), ")\n");
 
   } elsif (! &equal_hashes($tlpA->cataloguedata, $tlpB->cataloguedata)) {
     debug("$pkg: ", debug_hash_str("cataloguedata now", $tlpA->cataloguedata),
@@ -600,7 +599,6 @@
       " " x (length($pkg) + 7),
                     debug_hash_str("vs. compare db", $tlpB->cataloguedata));
 
-
   } elsif (! &equal_hashes($tlpA->docfiledata, $tlpB->docfiledata)) {
     debug("$pkg: docfiledata changed\n");
   
@@ -612,13 +610,13 @@
 }
 
 

-# Return true if A and B are the same strings: both undef, or both
-# defined and eq. (Writing out the defined tests each time is too annoying.)
+# Return ARG if it is defined, or empty string if ARG is undef.
+# It is irritating to have to do this, but it seems the best available
+# option to avoid uninitialized warnings. We could use the pragma, but
+# cleaner to program the checks. 
 # 
-sub equal_strings {
-  my ($a,$b) = @_;
-  return (!defined $a && !defined $b)
-         || (defined $a && defined $b && $a eq $b);
+sub suredef {
+  return defined $_[0] ? $_[0] : "";
 }
 
 


Modified: trunk/Master/tlpkg/doc/releng.txt
===================================================================
--- trunk/Master/tlpkg/doc/releng.txt	2022-09-25 15:03:22 UTC (rev 64502)
+++ trunk/Master/tlpkg/doc/releng.txt	2022-09-25 16:50:19 UTC (rev 64503)
@@ -561,26 +561,25 @@
 #
 # copy files from DVD:
 mount /mnt/tc
-cd /mnt/tc # check that it's the current release
-cp -pR [A-T]* index* setup /home/ftp/historic/systems/texcollection/$this
+cd /mnt/tc
+ls # check that it's the current release!
+cp -pR *.* setup /home/ftp/historic/systems/texcollection/$this
 #
 # copy ctan snapshot for TUG members:
-du -h ~www/members/ctan*20*.tar # just to compare
+du -h ~www/members/ctan2*.tar # just to compare
 mkdir $hy/ctancd/$prev
-mv ~www/members/ctan*20*.tar !$
+mv ~www/members/ctan2*.tar !$
 ls -lt ctan/ | head # note date of last update
 nice -19 tar cf ~www/members/ctan`date +%y`-0410.tar ctan # update date!
-chmod a=r ~www/members/ctan*.tar
+chmod a=r ~www/members/ctan2*.tar
 ls -l !$; du -h !$
 # edit members/index.html
-mkdir /home/ftp/historic/systems/ctancd/$this
-ln -v ~www/members/ctan*.tar !$
 #
 cd && umount /mnt/tc
 #
-cd $hy/$this/packaging
+cd $hy/texcollection/$this/packaging
 # copy in files from texcollection svn:
-svn -q update ~/src/texcollection/
+svn update ~/src/texcollection/
 cp -p ~/src/texcollection/$this/packaging/* .
 #
 # make small image for web page:



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