summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZack Weinberg <zackw@panix.com>2020-08-31 18:31:04 -0700
committerKarl Berry <karl@freefriends.org>2020-08-31 18:31:04 -0700
commit5cafaafd5b5fd3d14857a5f9db3285ea9cc435ab (patch)
tree731f07793e5a25d228e9d21606390b197bd786c1
parent39fd2153ff6c493c6cd8d8050689894a4f993ce3 (diff)
downloadautomake-5cafaafd5b5fd3d14857a5f9db3285ea9cc435ab.tar.gz
perl: use warnings instead of -w; consistent ordering of use, etc.
Per thread at: https://lists.gnu.org/archive/html/automake-patches/2020-08/msg00009.html * bin/aclocal.in: use warnings instead of #!...-w; consistent ordering of basic "use" directives, then BEGIN block, then standard modules in ASCII order, then Automake:: modules (not sort), finally use vars. Also sort @ISA lists and use qw(...) in ASCII order. * bin/automake.in: likewise. * lib/Automake/ChannelDefs.pm: likewise. * lib/Automake/Channels.pm: likewise. * lib/Automake/Condition.pm: likewise. * lib/Automake/Config.in: likewise. * lib/Automake/Configure_ac.pm: likewise. * lib/Automake/DisjConditions.pm: likewise. * lib/Automake/FileUtils.pm: likewise. * lib/Automake/General.pm: likewise. * lib/Automake/Getopt.pm: likewise. * lib/Automake/Item.pm: likewise. * lib/Automake/ItemDef.pm: likewise. * lib/Automake/Language.pm: likewise. * lib/Automake/Location.pm: likewise. * lib/Automake/Options.pm: likewise. * lib/Automake/Rule.pm: likewise. * lib/Automake/RuleDef.pm: likewise. * lib/Automake/VarDef.pm: likewise. * lib/Automake/Variable.pm: likewise. * lib/Automake/Version.pm: likewise. * lib/Automake/Wrap.pm: likewise. * lib/Automake/XFile.pm: remove unnecessary imports of Carp, DynaLoader, and File::Basename.
-rw-r--r--bin/aclocal.in11
-rw-r--r--bin/automake.in11
-rw-r--r--lib/Automake/ChannelDefs.pm25
-rw-r--r--lib/Automake/Channels.pm7
-rw-r--r--lib/Automake/Condition.pm10
-rw-r--r--lib/Automake/Config.in6
-rw-r--r--lib/Automake/Configure_ac.pm8
-rw-r--r--lib/Automake/DisjConditions.pm4
-rw-r--r--lib/Automake/FileUtils.pm6
-rw-r--r--lib/Automake/General.pm4
-rw-r--r--lib/Automake/Getopt.pm10
-rw-r--r--lib/Automake/Item.pm3
-rw-r--r--lib/Automake/ItemDef.pm2
-rw-r--r--lib/Automake/Language.pm2
-rw-r--r--lib/Automake/Location.pm2
-rw-r--r--lib/Automake/Options.pm6
-rw-r--r--lib/Automake/Rule.pm9
-rw-r--r--lib/Automake/RuleDef.pm9
-rw-r--r--lib/Automake/VarDef.pm9
-rw-r--r--lib/Automake/Variable.pm8
-rw-r--r--lib/Automake/Version.pm2
-rw-r--r--lib/Automake/Wrap.pm10
-rw-r--r--lib/Automake/XFile.pm19
23 files changed, 114 insertions, 69 deletions
diff --git a/bin/aclocal.in b/bin/aclocal.in
index b61fed818..c968bd710 100644
--- a/bin/aclocal.in
+++ b/bin/aclocal.in
@@ -1,4 +1,4 @@
-#!@PERL@ -w
+#!@PERL@
# aclocal - create aclocal.m4 by scanning configure.ac -*- perl -*-
# @configure_input@
# Copyright (C) 1996-2020 Free Software Foundation, Inc.
@@ -19,13 +19,18 @@
# Written by Tom Tromey <tromey@redhat.com>, and
# Alexandre Duret-Lutz <adl@gnu.org>.
+use 5.006;
+use strict;
+use warnings FATAL => 'all';
+
BEGIN
{
unshift (@INC, '@datadir@/@PACKAGE@-@APIVERSION@')
unless $ENV{AUTOMAKE_UNINSTALLED};
}
-use strict;
+use File::Basename;
+use File::Path ();
use Automake::Config;
use Automake::General;
@@ -34,8 +39,6 @@ use Automake::Channels;
use Automake::ChannelDefs;
use Automake::XFile;
use Automake::FileUtils;
-use File::Basename;
-use File::Path ();
# Some globals.
diff --git a/bin/automake.in b/bin/automake.in
index c12078711..1e4ccc8df 100644
--- a/bin/automake.in
+++ b/bin/automake.in
@@ -1,4 +1,4 @@
-#!@PERL@ -w
+#!@PERL@
# automake - create Makefile.in from Makefile.am -*- perl -*-
# @configure_input@
# Copyright (C) 1994-2020 Free Software Foundation, Inc.
@@ -22,7 +22,9 @@
package Automake;
+use 5.006;
use strict;
+use warnings FATAL => 'all';
BEGIN
{
@@ -39,6 +41,10 @@ BEGIN
$ENV{'SHELL'} = '@SHELL@' if exists $ENV{'DJDIR'};
}
+use Carp;
+use File::Basename;
+use File::Spec;
+
use Automake::Config;
BEGIN
{
@@ -66,9 +72,6 @@ use Automake::Rule;
use Automake::RuleDef;
use Automake::Wrap 'makefile_wrap';
use Automake::Language;
-use File::Basename;
-use File::Spec;
-use Carp;
## ----------------------- ##
## Subroutine prototypes. ##
diff --git a/lib/Automake/ChannelDefs.pm b/lib/Automake/ChannelDefs.pm
index 2ee6dd8ef..37c5a2715 100644
--- a/lib/Automake/ChannelDefs.pm
+++ b/lib/Automake/ChannelDefs.pm
@@ -15,17 +15,6 @@
package Automake::ChannelDefs;
-use Automake::Config;
-BEGIN
-{
- if ($perl_threads)
- {
- require threads;
- import threads;
- }
-}
-use Automake::Channels;
-
=head1 NAME
Automake::ChannelDefs - channel definitions for Automake and helper functions
@@ -57,10 +46,22 @@ shorthand function to output on specific channels.
use 5.006;
use strict;
+use warnings FATAL => 'all';
+
use Exporter;
-use vars qw (@ISA @EXPORT);
+use Automake::Channels;
+use Automake::Config;
+BEGIN
+{
+ if ($perl_threads)
+ {
+ require threads;
+ import threads;
+ }
+}
+use vars qw (@EXPORT @ISA);
@ISA = qw (Exporter);
@EXPORT = qw (&prog_error &error &fatal &verb
&switch_warning &parse_WARNINGS &parse_warnings);
diff --git a/lib/Automake/Channels.pm b/lib/Automake/Channels.pm
index 5fb01f550..7cc7ffdf6 100644
--- a/lib/Automake/Channels.pm
+++ b/lib/Automake/Channels.pm
@@ -68,12 +68,13 @@ etc.) that can also be overridden on a per-message basis.
use 5.006;
use strict;
-use Exporter;
+use warnings FATAL => 'all';
+
use Carp;
+use Exporter;
use File::Basename;
-use vars qw (@ISA @EXPORT %channels $me);
-
+use vars qw (@EXPORT @ISA %channels $me);
@ISA = qw (Exporter);
@EXPORT = qw ($exit_code $warnings_are_errors
&reset_local_duplicates &reset_global_duplicates
diff --git a/lib/Automake/Condition.pm b/lib/Automake/Condition.pm
index 764411691..072602afe 100644
--- a/lib/Automake/Condition.pm
+++ b/lib/Automake/Condition.pm
@@ -17,12 +17,14 @@ package Automake::Condition;
use 5.006;
use strict;
+use warnings FATAL => 'all';
+
use Carp;
+use Exporter;
-require Exporter;
-use vars '@ISA', '@EXPORT_OK';
-@ISA = qw/Exporter/;
-@EXPORT_OK = qw/TRUE FALSE reduce_and reduce_or/;
+use vars qw (@EXPORT_OK @ISA);
+@ISA = qw (Exporter);
+@EXPORT_OK = qw (TRUE FALSE reduce_and reduce_or);
=head1 NAME
diff --git a/lib/Automake/Config.in b/lib/Automake/Config.in
index f79b8cd40..d44e0ab94 100644
--- a/lib/Automake/Config.in
+++ b/lib/Automake/Config.in
@@ -16,10 +16,12 @@
# along with this program. If not, see <https://www.gnu.org/licenses/>.
package Automake::Config;
-use strict;
use 5.006;
-require Exporter;
+use strict;
+use warnings FATAL => 'all';
+
+use Exporter;
our @ISA = qw (Exporter);
our @EXPORT = qw ($APIVERSION $PACKAGE $PACKAGE_BUGREPORT $VERSION
diff --git a/lib/Automake/Configure_ac.pm b/lib/Automake/Configure_ac.pm
index d60191b88..0d9b465e6 100644
--- a/lib/Automake/Configure_ac.pm
+++ b/lib/Automake/Configure_ac.pm
@@ -22,12 +22,14 @@ package Automake::Configure_ac;
use 5.006;
use strict;
+use warnings FATAL => 'all';
+
use Exporter;
-use Automake::Channels;
-use Automake::ChannelDefs;
-use vars qw (@ISA @EXPORT);
+use Automake::ChannelDefs;
+use Automake::Channels;
+use vars qw (@EXPORT @ISA);
@ISA = qw (Exporter);
@EXPORT = qw (&find_configure_ac &require_configure_ac);
diff --git a/lib/Automake/DisjConditions.pm b/lib/Automake/DisjConditions.pm
index dbe311ebc..af9d1a955 100644
--- a/lib/Automake/DisjConditions.pm
+++ b/lib/Automake/DisjConditions.pm
@@ -17,8 +17,10 @@ package Automake::DisjConditions;
use 5.006;
use strict;
+use warnings FATAL => 'all';
+
use Carp;
-use Automake::Condition qw/TRUE FALSE/;
+use Automake::Condition qw (TRUE FALSE);
=head1 NAME
diff --git a/lib/Automake/FileUtils.pm b/lib/Automake/FileUtils.pm
index 40e236d4d..65f9216df 100644
--- a/lib/Automake/FileUtils.pm
+++ b/lib/Automake/FileUtils.pm
@@ -36,14 +36,16 @@ This perl module provides various general purpose file handling functions.
use 5.006;
use strict;
+use warnings FATAL => 'all';
+
use Exporter;
use File::stat;
use IO::File;
+
use Automake::Channels;
use Automake::ChannelDefs;
-use vars qw (@ISA @EXPORT);
-
+use vars qw (@EXPORT @ISA);
@ISA = qw (Exporter);
@EXPORT = qw (&contents
&find_file &mtime
diff --git a/lib/Automake/General.pm b/lib/Automake/General.pm
index dbb2138b6..ea7032cd1 100644
--- a/lib/Automake/General.pm
+++ b/lib/Automake/General.pm
@@ -17,10 +17,12 @@ package Automake::General;
use 5.006;
use strict;
+use warnings FATAL => 'all';
+
use Exporter;
use File::Basename;
-use vars qw (@ISA @EXPORT);
+use vars qw (@EXPORT @ISA);
@ISA = qw (Exporter);
@EXPORT = qw (&uniq &none $me);
diff --git a/lib/Automake/Getopt.pm b/lib/Automake/Getopt.pm
index f8dc0acaf..5d7d57bae 100644
--- a/lib/Automake/Getopt.pm
+++ b/lib/Automake/Getopt.pm
@@ -33,14 +33,16 @@ line options in conformance to the GNU Coding standards.
use 5.006;
use strict;
use warnings FATAL => 'all';
+
+use Carp qw (confess croak);
use Exporter ();
use Getopt::Long ();
-use Automake::ChannelDefs qw/fatal/;
-use Carp qw/croak confess/;
-use vars qw (@ISA @EXPORT);
+use Automake::ChannelDefs qw (fatal);
+
+use vars qw (@EXPORT @ISA);
@ISA = qw (Exporter);
-@EXPORT= qw/getopt/;
+@EXPORT = qw (getopt);
=item C<parse_options (%option)>
diff --git a/lib/Automake/Item.pm b/lib/Automake/Item.pm
index 85e114d9d..aee23e778 100644
--- a/lib/Automake/Item.pm
+++ b/lib/Automake/Item.pm
@@ -17,7 +17,10 @@ package Automake::Item;
use 5.006;
use strict;
+use warnings FATAL => 'all';
+
use Carp;
+
use Automake::ChannelDefs;
use Automake::DisjConditions;
diff --git a/lib/Automake/ItemDef.pm b/lib/Automake/ItemDef.pm
index debcaa521..995fb11eb 100644
--- a/lib/Automake/ItemDef.pm
+++ b/lib/Automake/ItemDef.pm
@@ -17,6 +17,8 @@ package Automake::ItemDef;
use 5.006;
use strict;
+use warnings FATAL => 'all';
+
use Carp;
=head1 NAME
diff --git a/lib/Automake/Language.pm b/lib/Automake/Language.pm
index 4d5fa8056..b85e0fa54 100644
--- a/lib/Automake/Language.pm
+++ b/lib/Automake/Language.pm
@@ -17,8 +17,10 @@ package Automake::Language;
use 5.006;
use strict;
+use warnings FATAL => 'all';
use Class::Struct ();
+
Class::Struct::struct (
# Short name of the language (c, f77...).
'name' => "\$",
diff --git a/lib/Automake/Location.pm b/lib/Automake/Location.pm
index 8e4d1c79f..611cd0220 100644
--- a/lib/Automake/Location.pm
+++ b/lib/Automake/Location.pm
@@ -16,6 +16,8 @@
package Automake::Location;
use 5.006;
+use strict;
+use warnings FATAL => 'all';
=head1 NAME
diff --git a/lib/Automake/Options.pm b/lib/Automake/Options.pm
index 59e29c583..5e20a3410 100644
--- a/lib/Automake/Options.pm
+++ b/lib/Automake/Options.pm
@@ -17,14 +17,16 @@ package Automake::Options;
use 5.006;
use strict;
+use warnings FATAL => 'all';
+
use Exporter;
+
use Automake::Config;
use Automake::ChannelDefs;
use Automake::Channels;
use Automake::Version;
-use vars qw (@ISA @EXPORT);
-
+use vars qw (@EXPORT @ISA);
@ISA = qw (Exporter);
@EXPORT = qw (option global_option
set_option set_global_option
diff --git a/lib/Automake/Rule.pm b/lib/Automake/Rule.pm
index 35e7b273f..0227a85d1 100644
--- a/lib/Automake/Rule.pm
+++ b/lib/Automake/Rule.pm
@@ -17,7 +17,10 @@ package Automake::Rule;
use 5.006;
use strict;
+use warnings FATAL => 'all';
+
use Carp;
+use Exporter;
use Automake::Item;
use Automake::RuleDef;
@@ -26,9 +29,9 @@ use Automake::Channels;
use Automake::Options;
use Automake::Condition qw (TRUE FALSE);
use Automake::DisjConditions;
-require Exporter;
-use vars '@ISA', '@EXPORT', '@EXPORT_OK';
-@ISA = qw/Automake::Item Exporter/;
+
+use vars qw (@EXPORT @EXPORT_OK @ISA);
+@ISA = qw (Automake::Item Exporter);
@EXPORT = qw (reset register_suffix_rule next_in_suffix_chain
suffixes rules $KNOWN_EXTENSIONS_PATTERN
depend %dependencies %actions register_action
diff --git a/lib/Automake/RuleDef.pm b/lib/Automake/RuleDef.pm
index d44f10819..091a78c50 100644
--- a/lib/Automake/RuleDef.pm
+++ b/lib/Automake/RuleDef.pm
@@ -17,13 +17,16 @@ package Automake::RuleDef;
use 5.006;
use strict;
+use warnings FATAL => 'all';
+
use Carp;
+use Exporter;
+
use Automake::ChannelDefs;
use Automake::ItemDef;
-require Exporter;
-use vars '@ISA', '@EXPORT';
-@ISA = qw/Automake::ItemDef Exporter/;
+use vars qw (@EXPORT @ISA);
+@ISA = qw (Automake::ItemDef Exporter);
@EXPORT = qw (&RULE_AUTOMAKE &RULE_USER);
=head1 NAME
diff --git a/lib/Automake/VarDef.pm b/lib/Automake/VarDef.pm
index d258a8573..adeb6e299 100644
--- a/lib/Automake/VarDef.pm
+++ b/lib/Automake/VarDef.pm
@@ -17,13 +17,16 @@ package Automake::VarDef;
use 5.006;
use strict;
+use warnings FATAL => 'all';
+
use Carp;
+use Exporter;
+
use Automake::ChannelDefs;
use Automake::ItemDef;
-require Exporter;
-use vars '@ISA', '@EXPORT';
-@ISA = qw/Automake::ItemDef Exporter/;
+use vars qw (@ISA @EXPORT);
+@ISA = qw (Automake::ItemDef Exporter);
@EXPORT = qw (&VAR_AUTOMAKE &VAR_CONFIGURE &VAR_MAKEFILE
&VAR_ASIS &VAR_PRETTY &VAR_SILENT &VAR_SORTED);
diff --git a/lib/Automake/Variable.pm b/lib/Automake/Variable.pm
index 363a3e0ed..4ec0dd4b0 100644
--- a/lib/Automake/Variable.pm
+++ b/lib/Automake/Variable.pm
@@ -17,7 +17,10 @@ package Automake::Variable;
use 5.006;
use strict;
+use warnings FATAL => 'all';
+
use Carp;
+use Exporter;
use Automake::Channels;
use Automake::ChannelDefs;
@@ -29,9 +32,8 @@ use Automake::DisjConditions;
use Automake::General 'uniq';
use Automake::Wrap 'makefile_wrap';
-require Exporter;
-use vars '@ISA', '@EXPORT', '@EXPORT_OK';
-@ISA = qw/Automake::Item Exporter/;
+use vars qw (@EXPORT @EXPORT_OK @ISA);
+@ISA = qw (Automake::Item Exporter);
@EXPORT = qw (err_var msg_var msg_cond_var reject_var
var rvar vardef rvardef
variables
diff --git a/lib/Automake/Version.pm b/lib/Automake/Version.pm
index c2722c061..16cdfb699 100644
--- a/lib/Automake/Version.pm
+++ b/lib/Automake/Version.pm
@@ -17,6 +17,8 @@ package Automake::Version;
use 5.006;
use strict;
+use warnings FATAL => 'all';
+
use Automake::ChannelDefs;
=head1 NAME
diff --git a/lib/Automake/Wrap.pm b/lib/Automake/Wrap.pm
index 0640cc9a2..c821b8b99 100644
--- a/lib/Automake/Wrap.pm
+++ b/lib/Automake/Wrap.pm
@@ -17,11 +17,13 @@ package Automake::Wrap;
use 5.006;
use strict;
+use warnings FATAL => 'all';
-require Exporter;
-use vars '@ISA', '@EXPORT_OK';
-@ISA = qw/Exporter/;
-@EXPORT_OK = qw/wrap makefile_wrap/;
+use Exporter;
+
+use vars qw (@EXPORT_OK @ISA);
+@ISA = qw (Exporter);
+@EXPORT_OK = qw (wrap makefile_wrap);
=head1 NAME
diff --git a/lib/Automake/XFile.pm b/lib/Automake/XFile.pm
index 7d54404f0..5284faa5d 100644
--- a/lib/Automake/XFile.pm
+++ b/lib/Automake/XFile.pm
@@ -71,23 +71,20 @@ and C<getlines> methods to translate C<\r\n> to C<\n>.
use 5.006;
use strict;
-use vars qw($VERSION @EXPORT @EXPORT_OK $AUTOLOAD @ISA);
-use Carp;
+use warnings FATAL => 'all';
+
use Errno;
+use Exporter;
use IO::File;
-use File::Basename;
+
use Automake::ChannelDefs;
-use Automake::Channels qw(msg);
+use Automake::Channels qw (msg);
use Automake::FileUtils;
-require Exporter;
-require DynaLoader;
-
-@ISA = qw(IO::File Exporter DynaLoader);
-
-$VERSION = "1.2";
-
+use vars qw ($AUTOLOAD @EXPORT @EXPORT_OK @ISA $VERSION);
+@ISA = qw(Exporter IO::File);
@EXPORT = @IO::File::EXPORT;
+$VERSION = "1.2";
eval {
# Make all Fcntl O_XXX and LOCK_XXX constants available for importing