summaryrefslogtreecommitdiff
path: root/bin
diff options
context:
space:
mode:
authorZack Weinberg <zackw@panix.com>2020-08-31 11:23:00 -0400
committerZack Weinberg <zackw@panix.com>2020-08-31 13:15:45 -0400
commit6d5e6ba9043df651fd1b1572ea1430c4269b091d (patch)
tree4657493a11dd15aac506706c9cd9a31355fc228f /bin
parent17c048d8593140bc178016fa46eac7d55e367266 (diff)
downloadautoconf-6d5e6ba9043df651fd1b1572ea1430c4269b091d.tar.gz
Rationalize ‘use’ order in Perl code.
All the Perl scripts and modules now ‘use’ other modules in the following order: - use 5.006; use strict; use warnings; in that order. If a file was not already use-ing one of these three, it was added. - The BEGIN block that adds the installation directory for the Autom4te:: modules to @INC, if necessary. - All stdlib modules whose name begins with a capital letter, in ASCII sort order. - All Autom4te:: modules, in ASCII sort order. - ‘use vars qw (...)’, if any, last. Also, ‘use foo qw (...)’ and @ISA lists have been sorted into ASCII sort order. (@EXPORT lists, which often follow immediately after @ISA lists, have *not* been sorted, as these appear to have been organized semantically in many cases.) qw delimiters have been normalized to round parentheses with a space between the qw and the open paren. * bin/autoheader.in, bin/autom4te.in, bin/autoreconf.in * bin/autoscan.in, bin/autoupdate.in, bin/ifnames.in * lib/Autom4te/C4che.pm, lib/Autom4te/ChannelDefs.pm * lib/Autom4te/Channels.pm, lib/Autom4te/Configure_ac.pm * lib/Autom4te/FileUtils.pm, lib/Autom4te/General.pm * lib/Autom4te/Getopt.pm, lib/Autom4te/Request.pm * lib/Autom4te/XFile.pm: Rationalize order and format of ‘use’ directives and @ISA lists. Add any of ‘use 5.006’, ‘use strict’, and ‘use warnings’ that was not already present.
Diffstat (limited to 'bin')
-rw-r--r--bin/autoheader.in7
-rw-r--r--bin/autom4te.in8
-rw-r--r--bin/autoreconf.in11
-rw-r--r--bin/autoscan.in13
-rw-r--r--bin/autoupdate.in9
-rw-r--r--bin/ifnames.in5
6 files changed, 35 insertions, 18 deletions
diff --git a/bin/autoheader.in b/bin/autoheader.in
index 2a9a2e07..3068e2b0 100644
--- a/bin/autoheader.in
+++ b/bin/autoheader.in
@@ -26,6 +26,10 @@ eval 'case $# in 0) exec @PERL@ -S "$0";; *) exec @PERL@ -S "$0" "$@";; esac'
# Written by Roland McGrath.
# Rewritten in Perl by Akim Demaille.
+use 5.006;
+use strict;
+use warnings;
+
BEGIN
{
my $pkgdatadir = $ENV{'autom4te_perllibdir'} || '@pkgdatadir@';
@@ -44,10 +48,9 @@ use Autom4te::Configure_ac;
use Autom4te::FileUtils;
use Autom4te::General;
use Autom4te::XFile;
-use strict;
# Using 'do FILE', we need 'local' vars.
-use vars qw ($config_h %verbatim %symbol);
+use vars qw ($config_h %symbol %verbatim);
# Lib files.
my $autom4te = $ENV{'AUTOM4TE'} || '@bindir@/@autom4te-name@';
diff --git a/bin/autom4te.in b/bin/autom4te.in
index 0662767d..f03fef07 100644
--- a/bin/autom4te.in
+++ b/bin/autom4te.in
@@ -22,6 +22,9 @@ eval 'case $# in 0) exec @PERL@ -S "$0";; *) exec @PERL@ -S "$0" "$@";; esac'
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <https://www.gnu.org/licenses/>.
+use 5.006;
+use strict;
+use warnings;
BEGIN
{
@@ -35,15 +38,14 @@ BEGIN
$ENV{'SHELL'} = '@SHELL@' if ($^O eq 'dos');
}
+use File::Basename;
+
use Autom4te::C4che;
use Autom4te::ChannelDefs;
use Autom4te::Channels;
use Autom4te::FileUtils;
use Autom4te::General;
use Autom4te::XFile;
-use File::Basename;
-use strict;
-use warnings;
# Data directory.
my $pkgdatadir = $ENV{'AC_MACRODIR'} || '@pkgdatadir@';
diff --git a/bin/autoreconf.in b/bin/autoreconf.in
index eea69da4..a3424f95 100644
--- a/bin/autoreconf.in
+++ b/bin/autoreconf.in
@@ -24,6 +24,10 @@ eval 'case $# in 0) exec @PERL@ -S "$0";; *) exec @PERL@ -S "$0" "$@";; esac'
# Written by David J. MacKenzie.
# Extended and rewritten in Perl by Akim Demaille.
+use 5.006;
+use strict;
+use warnings;
+
BEGIN
{
my $pkgdatadir = $ENV{'autom4te_perllibdir'} || '@pkgdatadir@';
@@ -36,16 +40,15 @@ BEGIN
$ENV{'SHELL'} = '@SHELL@' if ($^O eq 'dos');
}
+# Do not use Cwd::chdir, since it might hang.
+use Cwd qw (cwd);
+
use Autom4te::ChannelDefs;
use Autom4te::Channels;
use Autom4te::Configure_ac;
use Autom4te::FileUtils;
use Autom4te::General;
use Autom4te::XFile;
-# Do not use Cwd::chdir, since it might hang.
-use Cwd 'cwd';
-use strict;
-use warnings;
## ----------- ##
## Variables. ##
diff --git a/bin/autoscan.in b/bin/autoscan.in
index 0026c428..ef7e0c12 100644
--- a/bin/autoscan.in
+++ b/bin/autoscan.in
@@ -23,6 +23,10 @@
eval 'case $# in 0) exec @PERL@ -S "$0";; *) exec @PERL@ -S "$0" "$@";; esac'
if 0;
+use 5.006;
+use strict;
+use warnings;
+
BEGIN
{
my $pkgdatadir = $ENV{'autom4te_perllibdir'} || '@pkgdatadir@';
@@ -35,15 +39,14 @@ BEGIN
$ENV{'SHELL'} = '@SHELL@' if ($^O eq 'dos');
}
+use File::Basename;
+use File::Find;
+
use Autom4te::ChannelDefs;
use Autom4te::Configure_ac;
-use Autom4te::General;
use Autom4te::FileUtils;
+use Autom4te::General;
use Autom4te::XFile;
-use File::Basename;
-use File::Find;
-use strict;
-use warnings;
use vars qw(@cfiles @makefiles @shfiles @subdirs %printed);
diff --git a/bin/autoupdate.in b/bin/autoupdate.in
index af8dd55b..c4ae4bde 100644
--- a/bin/autoupdate.in
+++ b/bin/autoupdate.in
@@ -24,6 +24,10 @@
eval 'case $# in 0) exec @PERL@ -S "$0";; *) exec @PERL@ -S "$0" "$@";; esac'
if 0;
+use 5.006;
+use strict;
+use warnings;
+
BEGIN
{
my $pkgdatadir = $ENV{'autom4te_perllibdir'} || '@pkgdatadir@';
@@ -36,15 +40,14 @@ BEGIN
$ENV{'SHELL'} = '@SHELL@' if ($^O eq 'dos');
}
+use File::Basename;
+
use Autom4te::ChannelDefs;
use Autom4te::Channels;
use Autom4te::Configure_ac;
use Autom4te::FileUtils;
use Autom4te::General;
use Autom4te::XFile;
-use File::Basename;
-use strict;
-use warnings;
# Lib files.
my $autom4te = $ENV{'AUTOM4TE'} || '@bindir@/@autom4te-name@';
diff --git a/bin/ifnames.in b/bin/ifnames.in
index f60d3a0f..72abe881 100644
--- a/bin/ifnames.in
+++ b/bin/ifnames.in
@@ -29,6 +29,10 @@ eval 'case $# in 0) exec @PERL@ -S "$0";; *) exec @PERL@ -S "$0" "$@";; esac'
# Written by David MacKenzie <djm@gnu.ai.mit.edu>
# and Paul Eggert <eggert@twinsun.com>.
+use 5.006;
+use strict;
+use warnings;
+
BEGIN
{
my $pkgdatadir = $ENV{'autom4te_perllibdir'} || '@pkgdatadir@';
@@ -44,7 +48,6 @@ BEGIN
use Autom4te::General;
use Autom4te::XFile;
use Autom4te::FileUtils;
-use warnings;
# $HELP
# -----