texlive[51487] Master/tlpkg/TeXLive/TLPDB.pm: pinning: don't warn on

commits+preining at tug.org commits+preining at tug.org
Thu Jun 27 02:51:50 CEST 2019


Revision: 51487
          http://tug.org/svn/texlive?view=revision&revision=51487
Author:   preining
Date:     2019-06-27 02:51:49 +0200 (Thu, 27 Jun 2019)
Log Message:
-----------
pinning: don't warn on not-hit pattern in case of catch-all presence

If a pin
	repo:*
is found, we don't warn that a pattern
	repo:package
is not matched. Any other glob line than * will trigger warnings, i.e.
	repo:*a*
	repo:package
will give a warning that the second line is not matched, as before.

Modified Paths:
--------------
    trunk/Master/tlpkg/TeXLive/TLPDB.pm

Modified: trunk/Master/tlpkg/TeXLive/TLPDB.pm
===================================================================
--- trunk/Master/tlpkg/TeXLive/TLPDB.pm	2019-06-27 00:06:35 UTC (rev 51486)
+++ trunk/Master/tlpkg/TeXLive/TLPDB.pm	2019-06-27 00:51:49 UTC (rev 51487)
@@ -2816,6 +2816,21 @@
   # the default main:* is always considered to be matched
   $mainpin->{'hit'} = 1;
   push @pins, $mainpin;
+  # # sort pins so that we first check specific lines without occurrences of
+  # # special characters, and then those with special characters.
+  # # The definitions are based on glob style rules, saved in $pp->{'glob'}
+  # # so we simply check whether there is * or ? in the string
+  # @pins = sort {
+  #   my $ag = $a->{'glob'};
+  #   my $bg = $b->{'glob'};
+  #   my $cAs = () = $ag =~ /\*/g; # number of * in glob of $a
+  #   my $cBs = () = $bg =~ /\*/g; # number of * in glob of $b
+  #   my $cAq = () = $ag =~ /\?/g; # number of ? in glob of $a
+  #   my $cBq = () = $bg =~ /\?/g; # number of ? in glob of $b
+  #   my $aVal = 2 * $cAs + $cAq;
+  #   my $bVal = 2 * $cBs + $cBq;
+  #   $aVal <=> $bVal
+  # } @pins;
   for my $pkg (keys %pkgs) {
     PINS: for my $pp (@pins) {
       my $pre = $pp->{'re'};
@@ -2829,8 +2844,16 @@
     }
   }
   # check that all pinning lines where hit
+  # If a repository has a catch-all pin
+  #   foo:*
+  # then we do not warn about any other pin (foo:abcde) not being hit.
+  my %catchall;
   for my $p (@pins) {
+    $catchall{$p->{'repo'}} = 1 if ($p->{'glob'} eq "*");
+  }
+  for my $p (@pins) {
     next if defined($p->{'hit'});
+    next if defined($catchall{$p->{'repo'}});
     tlwarn("tlmgr (TLPDB): pinning warning: the package pattern ",
            $p->{'glob'}, " on the line:\n  ", $p->{'line'},
            "\n  does not match any package\n");



More information about the tex-live-commits mailing list