From e59c85deee5e92c444551086c1f2ced999b39d25 Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Tue, 21 Dec 2021 22:46:16 +0000 Subject: use strict; use warnings; declarations, filehandle barewords, our @disabled git-svn-id: svn://tug.org/texlive/trunk@61372 c570f23f-e606-0410-a88d-b1316a301751 --- Master/tlpkg/TeXLive/TLDownload.pm | 2 ++ Master/tlpkg/TeXLive/TLPDB.pm | 19 ++++++++++++------- Master/tlpkg/TeXLive/TLPOBJ.pm | 17 ++++++++++------- Master/tlpkg/TeXLive/TLPSRC.pm | 4 +++- Master/tlpkg/TeXLive/TLPaper.pm | 2 ++ Master/tlpkg/TeXLive/TLTREE.pm | 2 ++ Master/tlpkg/TeXLive/TLUtils.pm | 2 +- Master/tlpkg/TeXLive/TLWinGoo.pm | 6 ++++-- Master/tlpkg/TeXLive/TeXCatalogue.pm | 2 ++ 9 files changed, 38 insertions(+), 18 deletions(-) (limited to 'Master/tlpkg/TeXLive') diff --git a/Master/tlpkg/TeXLive/TLDownload.pm b/Master/tlpkg/TeXLive/TLDownload.pm index 8029f01c494..75fd01fa18b 100644 --- a/Master/tlpkg/TeXLive/TLDownload.pm +++ b/Master/tlpkg/TeXLive/TLDownload.pm @@ -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; diff --git a/Master/tlpkg/TeXLive/TLPDB.pm b/Master/tlpkg/TeXLive/TLPDB.pm index 1f258c4451e..be818fccaed 100644 --- a/Master/tlpkg/TeXLive/TLPDB.pm +++ b/Master/tlpkg/TeXLive/TLPDB.pm @@ -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 @@ sub from_file { 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 @@ sub writeout { 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 @@ available architectures as packages with revision number -1. 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 @@ sub generate_listfiles { $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_with_deps { 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 @@ sub install_package_files { 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 @@ sub install_package_files { @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) { diff --git a/Master/tlpkg/TeXLive/TLPOBJ.pm b/Master/tlpkg/TeXLive/TLPOBJ.pm index cb16745516f..f90c0b94d50 100644 --- a/Master/tlpkg/TeXLive/TLPOBJ.pm +++ b/Master/tlpkg/TeXLive/TLPOBJ.pm @@ -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 @@ sub _recompute_size { 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 @@ sub _recompute_size { } } 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 _recompute_size { 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 { 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 @@ sub make_container { $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 @@ sub updmap_cfg_lines { } +our @disabled; # global, should handle differently ... + sub language_dat_lines { my $self = shift; local @disabled = @_; # we use @disabled in the nested sub diff --git a/Master/tlpkg/TeXLive/TLPSRC.pm b/Master/tlpkg/TeXLive/TLPSRC.pm index 1305261ee5b..0a1146386ac 100644 --- a/Master/tlpkg/TeXLive/TLPSRC.pm +++ b/Master/tlpkg/TeXLive/TLPSRC.pm @@ -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 from_file { 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"; diff --git a/Master/tlpkg/TeXLive/TLPaper.pm b/Master/tlpkg/TeXLive/TLPaper.pm index 6c7bd0e34bd..672db8a452e 100644 --- a/Master/tlpkg/TeXLive/TLPaper.pm +++ b/Master/tlpkg/TeXLive/TLPaper.pm @@ -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$'; diff --git a/Master/tlpkg/TeXLive/TLTREE.pm b/Master/tlpkg/TeXLive/TLTREE.pm index 89054437014..855a976b566 100644 --- a/Master/tlpkg/TeXLive/TLTREE.pm +++ b/Master/tlpkg/TeXLive/TLTREE.pm @@ -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$'; diff --git a/Master/tlpkg/TeXLive/TLUtils.pm b/Master/tlpkg/TeXLive/TLUtils.pm index 1e94b4359a2..6fcc60230bb 100644 --- a/Master/tlpkg/TeXLive/TLUtils.pm +++ b/Master/tlpkg/TeXLive/TLUtils.pm @@ -2666,7 +2666,7 @@ END_COMPRESSOR_BAD 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 diff --git a/Master/tlpkg/TeXLive/TLWinGoo.pm b/Master/tlpkg/TeXLive/TLWinGoo.pm index 941ee315159..94c7877ebb7 100644 --- a/Master/tlpkg/TeXLive/TLWinGoo.pm +++ b/Master/tlpkg/TeXLive/TLWinGoo.pm @@ -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 @@ All exported functions return forward slashes. 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 @@ sub is_a_texdir { $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; diff --git a/Master/tlpkg/TeXLive/TeXCatalogue.pm b/Master/tlpkg/TeXLive/TeXCatalogue.pm index e7a753a63ad..591cee5196e 100644 --- a/Master/tlpkg/TeXLive/TeXCatalogue.pm +++ b/Master/tlpkg/TeXLive/TeXCatalogue.pm @@ -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; -- cgit v1.2.3