]> git.ipfire.org Git - thirdparty/automake.git/commitdiff
perl: use warnings instead of -w; consistent ordering of use, etc.
authorZack Weinberg <zackw@panix.com>
Tue, 1 Sep 2020 01:31:04 +0000 (18:31 -0700)
committerKarl Berry <karl@freefriends.org>
Tue, 1 Sep 2020 01:31:04 +0000 (18:31 -0700)
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.

23 files changed:
bin/aclocal.in
bin/automake.in
lib/Automake/ChannelDefs.pm
lib/Automake/Channels.pm
lib/Automake/Condition.pm
lib/Automake/Config.in
lib/Automake/Configure_ac.pm
lib/Automake/DisjConditions.pm
lib/Automake/FileUtils.pm
lib/Automake/General.pm
lib/Automake/Getopt.pm
lib/Automake/Item.pm
lib/Automake/ItemDef.pm
lib/Automake/Language.pm
lib/Automake/Location.pm
lib/Automake/Options.pm
lib/Automake/Rule.pm
lib/Automake/RuleDef.pm
lib/Automake/VarDef.pm
lib/Automake/Variable.pm
lib/Automake/Version.pm
lib/Automake/Wrap.pm
lib/Automake/XFile.pm

index b61fed81801bf56eb1f1397118205cb9afccf86a..c968bd7108f9b135ec4bd0e63ab37faac2b210aa 100644 (file)
@@ -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.
 # 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.
 
index c12078711b04de6b5e22d9efb99669c0d2a0f8c9..1e4ccc8df15dad82af72fa4c9fef64e6f89887d3 100644 (file)
@@ -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.  ##
index 2ee6dd8efd770aab43f3723b34c6dd87a8f4153f..37c5a2715dd6623d21c8d150a190a4d69f1fce7b 100644 (file)
 
 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);
index 5fb01f550265d1f310b67a7979a31e6b078558b8..7cc7ffdf6e504a112b225a19408c7b32aaf27a07 100644 (file)
@@ -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
index 764411691e7d282575fbf74e8c7688d4be898143..072602afec9a34aac43d17b1ff8385c592d7026e 100644 (file)
@@ -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
 
index f79b8cd4095d675c313e77f6d86453a5cf97a8f9..d44e0ab94a322bbaea8eb2a767dcecf4cac773e6 100644 (file)
 # 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
index d60191b881a9116602651daaa49e8dbc02c0a95c..0d9b465e68b1e9a2f5dc047c197e3f6968f296bf 100644 (file)
@@ -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);
 
index dbe311ebc337a01e07c50ca3b8eeb0b6de0a83aa..af9d1a95583e59d0b9800d7be6479ab33ac04ab3 100644 (file)
@@ -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
 
index 40e236d4d538052bfd83c187c01acd12b0522f0a..65f9216dfa2893518f73dfa0259296e405e0d2c4 100644 (file)
@@ -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
index dbb2138b608022a4a5e26374e389128e225c398c..ea7032cd1c2783ce5997644597edac4b329d98d7 100644 (file)
@@ -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);
index f8dc0acaf28ca948b4a1c10776ef66e3f078ce38..5d7d57bae49844aff736108d32461196fc9bd63e 100644 (file)
@@ -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)>
 
index 85e114d9d9c0399fe19ad301b5283b9b12a3213d..aee23e778071a9e534d691ad5a049681211e3f3d 100644 (file)
@@ -17,7 +17,10 @@ package Automake::Item;
 
 use 5.006;
 use strict;
+use warnings FATAL => 'all';
+
 use Carp;
+
 use Automake::ChannelDefs;
 use Automake::DisjConditions;
 
index debcaa5213c46a2078926f26e4b7287b99739e54..995fb11eb5291c564eac0380c10749d5a2dd9750 100644 (file)
@@ -17,6 +17,8 @@ package Automake::ItemDef;
 
 use 5.006;
 use strict;
+use warnings FATAL => 'all';
+
 use Carp;
 
 =head1 NAME
index 4d5fa8056396a90497d6fa15a1be4745b50d12f2..b85e0fa542335cd7632cd697882757f76b6c2a9f 100644 (file)
@@ -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' => "\$",
index 8e4d1c79f9848473e6c0faa460e97ff605b00df4..611cd02204052f9656affb3247644b75c8d610db 100644 (file)
@@ -16,6 +16,8 @@
 package Automake::Location;
 
 use 5.006;
+use strict;
+use warnings FATAL => 'all';
 
 =head1 NAME
 
index 59e29c583531a08fd3b75a10be833250d57ff4c8..5e20a34100dfb8f22b41157c4b17884fc6f824a9 100644 (file)
@@ -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
index 35e7b273f962b5c446d310d5ee8d7311fce38056..0227a85d1608053951b89ce3fa0e5eb706f972ea 100644 (file)
@@ -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
index d44f10819487c4c30c34a13440a40b63d80a4189..091a78c50440c38b5c4d5a521ca94135f2b1546d 100644 (file)
@@ -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
index d258a85732659c03f0fd537a2b5713d6606b9e55..adeb6e299a0f8d86f3e436a1d6032bd10fda946a 100644 (file)
@@ -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);
 
index 363a3e0ed47bb26f2a3cb91991a03a7a8091f139..4ec0dd4b0e545a4bb92e08d2bb5e7b90e38fffd8 100644 (file)
@@ -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
index c2722c061cd0e08e96307473de29f2eca368564f..16cdfb699801275c4dc5d6c1f6c94b5cd88dee49 100644 (file)
@@ -17,6 +17,8 @@ package Automake::Version;
 
 use 5.006;
 use strict;
+use warnings FATAL => 'all';
+
 use Automake::ChannelDefs;
 
 =head1 NAME
index 0640cc9a2ffac02ecf7a0b82c7ba582ae8c37ce3..c821b8b993a2216f60f7281198f4c6e02bdc1c3f 100644 (file)
@@ -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
 
index 7d54404f08616d2c776fd1d50f09c4f222ecd92c..5284faa5d09f8f7d083792d01942d7eaeb10603f 100644 (file)
@@ -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