From fa8b0b514382f8095abcbea39c7b2b88db9fc1f4 Mon Sep 17 00:00:00 2001 From: Peter Eisentraut Date: Fri, 23 Sep 2016 12:00:00 -0400 Subject: [PATCH] perlcritic --- wwwtools/nls-status-page | 14 +++++++------- wwwtools/nls-status-table | 11 ++++++----- wwwtools/pg-make-po | 12 ++++++------ 3 files changed, 19 insertions(+), 18 deletions(-) diff --git a/wwwtools/nls-status-page b/wwwtools/nls-status-page index f3cca0e..f33698f 100755 --- a/wwwtools/nls-status-page +++ b/wwwtools/nls-status-page @@ -89,9 +89,8 @@ my %branch_status = ( my @branches = map { m!table-([^/]+).html$! && $1 } reverse sort glob("$dir/table-*.html"); -my ($b, $title); - -foreach $b (@branches) { +foreach my $b (@branches) { + my $title; ($title = $b) =~ tr/-/ /; print "
  • $title — $branch_status{$b}
  • \n"; } @@ -111,13 +110,14 @@ print <<_EOF_; --> _EOF_ -foreach $b (@branches) { +foreach my $b (@branches) { + my $title; ($title = $b) =~ tr/-/ /; print "

    ", ucfirst($title), "

    \n"; - open F, "$dir/table-${b}.html" or die $!; - print foreach ; - close F; + open my $f, '<', "$dir/table-${b}.html" or die $!; + print foreach <$f>; + close $f; print "

    qualified list

    \n" if -e "$dir/qualified-list-$b.txt"; } diff --git a/wwwtools/nls-status-table b/wwwtools/nls-status-table index c21dd8e..01b6485 100755 --- a/wwwtools/nls-status-table +++ b/wwwtools/nls-status-table @@ -1,10 +1,11 @@ -#! /usr/bin/perl -w +#! /usr/bin/perl # Prerequisites: # Input files given as argument (e.g., *.po) # set URL with -U option use strict; +use warnings; use File::Basename; use Getopt::Std; @@ -16,8 +17,8 @@ our $QUALIFIED_CUTOFF = 80; my %opts; getopts('U:l:', \%opts) or die; my $po_url = $opts{'U'} || 'po'; -my $list_file = $opts{'l'}; -open LIST, '>', $opts{'l'} if $list_file; +my $list_filename = $opts{'l'}; +open my $list_fh, '>', $opts{'l'} if $list_filename; my $everything; my $errors; @@ -147,7 +148,7 @@ foreach my $catalog (sort @catalogs) { } print "\n"; - print LIST "$catalog/$lang\n" if $list_file and defined $pct and $pct >= $QUALIFIED_CUTOFF; + print $list_fh "$catalog/$lang\n" if $list_filename and defined $pct and $pct >= $QUALIFIED_CUTOFF; } print ""; @@ -182,7 +183,7 @@ print "\n\n"; print "\n"; print "\n"; -close LIST if $list_file; +close $list_fh if $list_filename; sub list_sum { my $total; diff --git a/wwwtools/pg-make-po b/wwwtools/pg-make-po index c0776ab..7aad458 100755 --- a/wwwtools/pg-make-po +++ b/wwwtools/pg-make-po @@ -1,4 +1,4 @@ -#! /usr/bin/perl -w +#! /usr/bin/perl # Prerequisites: # GNU make (envar GMAKE) @@ -10,6 +10,7 @@ # Produces various output on stderr use strict; +use warnings; use Getopt::Std; use File::Basename; @@ -78,16 +79,15 @@ undef %saw; foreach (@ARGV) { my $dirname = dirname($_); - open NLSMK, "<$_" or die "could not open $_: $!\n"; + open my $nlsmk, '<', $_ or die "could not open $_: $!\n"; my $catalogname; - my $lang; - while () { + while (<$nlsmk>) { /^CATALOG_NAME\s*:?=\s*(\S+)\s*$/ and $catalogname = $1; } - close NLSMK; + close $nlsmk; system("$gmake -C $dirname init-po") == 0 or die "$!\n"; system("cp -f $dirname/po/$catalogname.pot $outdir/$catalogname.pot") == 0 or die "$!\n"; @@ -95,7 +95,7 @@ foreach (@ARGV) { my $avail_languages = join(' ', map { m!/([^/]+)\.po$! && $1 } glob("$dirname/po/*.po")); print STDERR "* $catalogname\n"; - foreach $lang (@all_languages) { + foreach my $lang (@all_languages) { print STDERR "$lang: "; system("rm -f $outdir/$catalogname-$lang.po.err"); -- 2.39.5