texlive[61372] Master/tlpkg/TeXLive: use strict; use warnings;

commits+karl at tug.org commits+karl at tug.org
Tue Dec 21 23:46:17 CET 2021


Revision: 61372
          http://tug.org/svn/texlive?view=revision&revision=61372
Author:   karl
Date:     2021-12-21 23:46:16 +0100 (Tue, 21 Dec 2021)
Log Message:
-----------
use strict; use warnings; declarations, filehandle barewords, our @disabled

Modified Paths:
--------------
    trunk/Master/tlpkg/TeXLive/TLDownload.pm
    trunk/Master/tlpkg/TeXLive/TLPDB.pm
    trunk/Master/tlpkg/TeXLive/TLPOBJ.pm
    trunk/Master/tlpkg/TeXLive/TLPSRC.pm
    trunk/Master/tlpkg/TeXLive/TLPaper.pm
    trunk/Master/tlpkg/TeXLive/TLTREE.pm
    trunk/Master/tlpkg/TeXLive/TLUtils.pm
    trunk/Master/tlpkg/TeXLive/TLWinGoo.pm
    trunk/Master/tlpkg/TeXLive/TeXCatalogue.pm

Modified: trunk/Master/tlpkg/TeXLive/TLDownload.pm
===================================================================
--- trunk/Master/tlpkg/TeXLive/TLDownload.pm	2021-12-21 21:50:06 UTC (rev 61371)
+++ trunk/Master/tlpkg/TeXLive/TLDownload.pm	2021-12-21 22:46:16 UTC (rev 61372)
@@ -4,6 +4,8 @@
 # This file is licensed under the GNU General Public License version 2
 # or any later version.
 
+use strict; use warnings;
+
 package TeXLive::TLDownload;
 
 use TeXLive::TLUtils;

Modified: trunk/Master/tlpkg/TeXLive/TLPDB.pm
===================================================================
--- trunk/Master/tlpkg/TeXLive/TLPDB.pm	2021-12-21 21:50:06 UTC (rev 61371)
+++ trunk/Master/tlpkg/TeXLive/TLPDB.pm	2021-12-21 22:46:16 UTC (rev 61372)
@@ -4,6 +4,7 @@
 # This file is licensed under the GNU General Public License version 2
 # or any later version.
 
+use strict; use warnings;
 package TeXLive::TLPDB;
 
 my $svnrev = '$Revision$';
@@ -281,6 +282,7 @@
   my $is_verified = 0;
   # do media detection
   my $rootpath = $self->root;
+  my $media;
   if ($rootpath =~ m,https?://|ftp://,) {
     $media = 'NET';
   } elsif ($rootpath =~ m,$TeXLive::TLUtils::SshURIRegex,) {
@@ -423,7 +425,7 @@
     tlwarn("TLPDB: cannot writeout a virtual tlpdb\n");
     return 0;
   }
-  my $fd = (@_ ? $_[0] : STDOUT);
+  my $fd = (@_ ? $_[0] : *STDOUT);
   foreach (sort keys %{$self->{'tlps'}}) {
     TeXLive::TLUtils::dddebug("writeout: tlpname=$_  ",
                               $self->{'tlps'}{$_}->name, "\n");
@@ -990,7 +992,7 @@
 
 sub generate_packagelist {
   my $self = shift;
-  my $fd = (@_ ? $_[0] : STDOUT);
+  my $fd = (@_ ? $_[0] : *STDOUT);
   foreach (sort $self->list_packages) {
     print $fd $self->get_package($_)->name, " ",
               $self->get_package($_)->revision, "\n";
@@ -1017,7 +1019,7 @@
     $destdir = TeXLive::TLPDB->listdir;
   }
   foreach (sort $self->list_package) {
-    $tlp = $self->get_package($_);
+    my $tlp = $self->get_package($_);
     $self->_generate_listfile($tlp, $destdir);
   }
 }
@@ -1465,7 +1467,7 @@
 sub _sizes_of_packages {
   my ($self, $with_deps, $opt_src, $opt_doc, $arch_list_ref, @packs) = @_;
   @packs || ( @packs = $self->list_packages() );
-  my @expacks;
+  my @exppacks;
   if ($with_deps) {
     # don't expand collection->collection dependencies
     #@exppacks = $self->expand_dependencies('-no-collections', $self, @packs);
@@ -1623,7 +1625,8 @@
     my ($tlpobjfile, $anotherfile) = <$tmpdir/tlpkg/tlpobj/*.tlpobj>;
     if (defined($anotherfile)) {
       # we found several tlpobj files, that is not allowed, stop
-      tlwarn("TLPDB::install_package_files: several tlpobj files in $what in tlpkg/tlpobj/, stopping!\n");
+      tlwarn("TLPDB::install_package_files: several tlpobj files "
+             . "($tlpobjfile, $anotherfile) in tlpkg/tlpobj/, stopping!\n");
       next;
     }
     # - read the tlpobj from there
@@ -1651,8 +1654,10 @@
     @installfiles = map { s!^$RelocPrefix/!!; $_; } @installfiles;
     # if the first argument of _install_data is scalar, it is the
     # place from where files should be installed
-    if (!_install_data ($tmpdir, \@installfiles, $reloc, \@installfiles, $self)) {
-      tlwarn("TLPDB::install_package_files: couldn't install $what!\n"); 
+    if (!_install_data ($tmpdir, \@installfiles, $reloc, \@installfiles,
+                        $self)) {
+      tlwarn("TLPDB::install_package_files: couldn't install_data files: "
+             . "@installfiles\n"); 
       next;
     }
     if ($reloc) {

Modified: trunk/Master/tlpkg/TeXLive/TLPOBJ.pm
===================================================================
--- trunk/Master/tlpkg/TeXLive/TLPOBJ.pm	2021-12-21 21:50:06 UTC (rev 61371)
+++ trunk/Master/tlpkg/TeXLive/TLPOBJ.pm	2021-12-21 22:46:16 UTC (rev 61372)
@@ -4,6 +4,8 @@
 # This file is licensed under the GNU General Public License version 2
 # or any later version.
 
+use strict; use warnings;
+
 package TeXLive::TLPOBJ;
 
 my $svnrev = '$Revision$';
@@ -249,7 +251,7 @@
   if ($type eq "bin") {
     my %binfiles = %{$self->{'binfiles'}};
     if (defined($binfiles{$arch})) {
-      foreach $f (@{$binfiles{$arch}}) {
+      foreach my $f (@{$binfiles{$arch}}) {
         my $s = $tltree->size_of($f);
         $nrivblocks += int($s/$TeXLive::TLConfig::BlockSize);
         $nrivblocks++ if (($s%$TeXLive::TLConfig::BlockSize) > 0);
@@ -257,7 +259,7 @@
     }
   } else {
     if (defined($self->{"${type}files"}) && (@{$self->{"${type}files"}})) {
-      foreach $f (@{$self->{"${type}files"}}) {
+      foreach my $f (@{$self->{"${type}files"}}) {
         my $s = $tltree->size_of($f);
         if (defined($s)) {
           $nrivblocks += int($s/$TeXLive::TLConfig::BlockSize);
@@ -273,7 +275,7 @@
 
 sub writeout {
   my $self = shift;
-  my $fd = (@_ ? $_[0] : STDOUT);
+  my $fd = (@_ ? $_[0] : *STDOUT);
   print $fd "name ", $self->name, "\n";
   print $fd "category ", $self->category, "\n";
   defined($self->{'revision'}) && print $fd "revision $self->{'revision'}\n";
@@ -377,7 +379,7 @@
 
 sub writeout_simple {
   my $self = shift;
-  my $fd = (@_ ? $_[0] : STDOUT);
+  my $fd = (@_ ? $_[0] : *STDOUT);
   print $fd "name ", $self->name, "\n";
   print $fd "category ", $self->category, "\n";
   if (defined($self->{'depends'})) {
@@ -633,9 +635,8 @@
   $selfcopy->writeout(\*TMP);
   close(TMP);
   push(@files, "$tlpobjdir/$self->{'name'}.tlpobj");
-  # Switch to versioned containers
-  # $tarname = "$containername.tar";
-  $tarname = "$containername.r" . $self->revision . ".tar";
+  # versioned containers
+  my $tarname = "$containername.r" . $self->revision . ".tar";
   my $unversionedtar;
   $unversionedtar = "$containername.tar" if (! $user);
 
@@ -1134,6 +1135,8 @@
 }
 
 
+our @disabled; # global, should handle differently ...
+
 sub language_dat_lines {
   my $self = shift;
   local @disabled = @_;  # we use @disabled in the nested sub

Modified: trunk/Master/tlpkg/TeXLive/TLPSRC.pm
===================================================================
--- trunk/Master/tlpkg/TeXLive/TLPSRC.pm	2021-12-21 21:50:06 UTC (rev 61371)
+++ trunk/Master/tlpkg/TeXLive/TLPSRC.pm	2021-12-21 22:46:16 UTC (rev 61372)
@@ -4,6 +4,8 @@
 # This file is licensed under the GNU General Public License version 2
 # or any later version.
 
+use strict; use warnings;
+
 package TeXLive::TLPSRC;
 
 use FileHandle;
@@ -263,7 +265,7 @@
 

 sub writeout {
   my $self = shift;
-  my $fd = (@_ ? $_[0] : STDOUT);
+  my $fd = (@_ ? $_[0] : *STDOUT);
   format_name $fd "multilineformat";  # format defined in TLPOBJ, and $:
   $fd->format_lines_per_page (99999); # no pages in this format
   print $fd "name ", $self->name, "\n";

Modified: trunk/Master/tlpkg/TeXLive/TLPaper.pm
===================================================================
--- trunk/Master/tlpkg/TeXLive/TLPaper.pm	2021-12-21 21:50:06 UTC (rev 61371)
+++ trunk/Master/tlpkg/TeXLive/TLPaper.pm	2021-12-21 22:46:16 UTC (rev 61372)
@@ -4,6 +4,8 @@
 # This file is licensed under the GNU General Public License version 2
 # or any later version.
 
+use strict; use warnings;
+
 package TeXLive::TLPaper;
 
 my $svnrev = '$Revision$';

Modified: trunk/Master/tlpkg/TeXLive/TLTREE.pm
===================================================================
--- trunk/Master/tlpkg/TeXLive/TLTREE.pm	2021-12-21 21:50:06 UTC (rev 61371)
+++ trunk/Master/tlpkg/TeXLive/TLTREE.pm	2021-12-21 22:46:16 UTC (rev 61372)
@@ -4,6 +4,8 @@
 # This file is licensed under the GNU General Public License version 2
 # or any later version.
 
+use strict; use warnings;
+
 package TeXLive::TLTREE;
 
 my $svnrev = '$Revision$';

Modified: trunk/Master/tlpkg/TeXLive/TLUtils.pm
===================================================================
--- trunk/Master/tlpkg/TeXLive/TLUtils.pm	2021-12-21 21:50:06 UTC (rev 61371)
+++ trunk/Master/tlpkg/TeXLive/TLUtils.pm	2021-12-21 22:46:16 UTC (rev 61372)
@@ -2666,7 +2666,7 @@
   if ($::opt_verbosity >= 2) {
     require Data::Dumper;
     # avoid spurious "used only once" warnings due to require
-    # (warnings restored at end of scope):
+    # (warnings restored at end of scope). https://perlmonks.org/?node_id=3333
     no warnings 'once';
     local $Data::Dumper::Sortkeys = 1;  # stable output
     local $Data::Dumper::Purity = 1;    # reconstruct recursive structures

Modified: trunk/Master/tlpkg/TeXLive/TLWinGoo.pm
===================================================================
--- trunk/Master/tlpkg/TeXLive/TLWinGoo.pm	2021-12-21 21:50:06 UTC (rev 61371)
+++ trunk/Master/tlpkg/TeXLive/TLWinGoo.pm	2021-12-21 22:46:16 UTC (rev 61372)
@@ -9,6 +9,8 @@
 # This program is free software; you can redistribute it and/or modify it
 # under the same terms as Perl itself.
 
+#use strict; use warnings; notyet
+
 package TeXLive::TLWinGoo;
 
 my $svnrev = '$Revision$';
@@ -86,7 +88,7 @@
 
 BEGIN {
   use Exporter;
-  use vars qw( @ISA @EXPORT $Registry);
+  use vars qw( @ISA @EXPORT @EXPORT_OK $Registry);
   @ISA = qw( Exporter );
   @EXPORT = qw(
     &is_ten
@@ -343,7 +345,7 @@
   $sr =~ s/\\/\//g;
   $sr = $sr . '/' unless $sr =~ m!/$!;
   return 0 if index($d, $sr)==0;
-  foreach $p (qw(luatex.exe mktexlsr.exe pdftex.exe tex.exe xetex.exe)) {
+  foreach my $p (qw(luatex.exe mktexlsr.exe pdftex.exe tex.exe xetex.exe)) {
     return 1 if (-e $d.$p);
   }
   return 0;

Modified: trunk/Master/tlpkg/TeXLive/TeXCatalogue.pm
===================================================================
--- trunk/Master/tlpkg/TeXLive/TeXCatalogue.pm	2021-12-21 21:50:06 UTC (rev 61371)
+++ trunk/Master/tlpkg/TeXLive/TeXCatalogue.pm	2021-12-21 22:46:16 UTC (rev 61372)
@@ -6,6 +6,8 @@
 # 
 # Loads of code adapted from the catalogue checking script of Robin Fairbairns.
 
+use strict; use warnings;
+
 use XML::Parser;
 use XML::XPath;
 use XML::XPath::XMLParser;



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