summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSerhii Popovych <spopovyc@cisco.com>2016-02-10 16:32:44 +0000
committerZack Weinberg <zackw@panix.com>2020-08-31 13:11:46 -0400
commit17c048d8593140bc178016fa46eac7d55e367266 (patch)
tree3a591721ba830d7ce477ee101bfe3e399055cb34
parent77153965c69e364e8bbd6711a4d04bfe28bdbcea (diff)
downloadautoconf-17c048d8593140bc178016fa46eac7d55e367266.tar.gz
perl: Replace -w option in shebangs with ‘use warnings’ in code
Some downstream redistributors for Autoconf wish to use ‘/usr/bin/env perl’ as the #! line for the installed Perl scripts. This does not work with command-line options on the #! line, as the kernel doesn’t support supplying more than one argument to a #! interpreter (this limitation is universal across Unixes that support #!, as far as I know). Remove ‘-w’ from all perl #! lines and instead add ‘use warnings’ to all the scripts and .pm files that didn’t already have it. This ‘use’ directive was added to Perl in version 5.6.0 (aka 5.006) so there is no change to our minimum Perl requirement. (It is necessary to add ‘use warnings’ to all the .pm files as well as the scripts, because the ‘-w’ command-line option turns on warnings globally, but ‘use warnings’ does so only for the current lexical scope.) Patch uplifted from OpenEmbedded, originally by Serhii Popovych. It’s a mechanical search-and-replace change so I do not believe a copyright assignment is necessary. * bin/autom4te.in, bin/autoreconf.in, bin/autoscan.in * bin/autoupdate.in, bin/ifnames.in: Remove -w from #! line and add ‘use warnings’ to imports. * 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/Request.pm, lib/Autom4te/XFile.pm: Add ‘use warnings’ to imports.
-rw-r--r--bin/autom4te.in3
-rw-r--r--bin/autoreconf.in3
-rw-r--r--bin/autoscan.in3
-rw-r--r--bin/autoupdate.in3
-rw-r--r--bin/ifnames.in3
-rw-r--r--lib/Autom4te/C4che.pm1
-rw-r--r--lib/Autom4te/ChannelDefs.pm1
-rw-r--r--lib/Autom4te/Channels.pm1
-rw-r--r--lib/Autom4te/Configure_ac.pm1
-rw-r--r--lib/Autom4te/FileUtils.pm1
-rw-r--r--lib/Autom4te/General.pm2
-rw-r--r--lib/Autom4te/Request.pm1
-rw-r--r--lib/Autom4te/XFile.pm1
13 files changed, 18 insertions, 6 deletions
diff --git a/bin/autom4te.in b/bin/autom4te.in
index d98998de..0662767d 100644
--- a/bin/autom4te.in
+++ b/bin/autom4te.in
@@ -1,4 +1,4 @@
-#! @PERL@ -w
+#! @PERL@
# -*- perl -*-
# @configure_input@
@@ -43,6 +43,7 @@ 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 873ef7a4..eea69da4 100644
--- a/bin/autoreconf.in
+++ b/bin/autoreconf.in
@@ -1,4 +1,4 @@
-#! @PERL@ -w
+#! @PERL@
# -*- perl -*-
# @configure_input@
@@ -45,6 +45,7 @@ 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 9780f7db..0026c428 100644
--- a/bin/autoscan.in
+++ b/bin/autoscan.in
@@ -1,4 +1,4 @@
-#! @PERL@ -w
+#! @PERL@
# -*- perl -*-
# @configure_input@
@@ -43,6 +43,7 @@ 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 16b88abb..af8dd55b 100644
--- a/bin/autoupdate.in
+++ b/bin/autoupdate.in
@@ -1,4 +1,4 @@
-#! @PERL@ -w
+#! @PERL@
# -*- perl -*-
# @configure_input@
@@ -44,6 +44,7 @@ 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 c0c1f58b..f60d3a0f 100644
--- a/bin/ifnames.in
+++ b/bin/ifnames.in
@@ -1,4 +1,4 @@
-#! @PERL@ -w
+#! @PERL@
# -*- perl -*-
# @configure_input@
@@ -44,6 +44,7 @@ BEGIN
use Autom4te::General;
use Autom4te::XFile;
use Autom4te::FileUtils;
+use warnings;
# $HELP
# -----
diff --git a/lib/Autom4te/C4che.pm b/lib/Autom4te/C4che.pm
index 76486e6a..6226cd63 100644
--- a/lib/Autom4te/C4che.pm
+++ b/lib/Autom4te/C4che.pm
@@ -35,6 +35,7 @@ use Data::Dumper;
use Autom4te::Request;
use Carp;
use strict;
+use warnings;
=over 4
diff --git a/lib/Autom4te/ChannelDefs.pm b/lib/Autom4te/ChannelDefs.pm
index 7a93583f..c706b6dc 100644
--- a/lib/Autom4te/ChannelDefs.pm
+++ b/lib/Autom4te/ChannelDefs.pm
@@ -49,6 +49,7 @@ shorthand function to output on specific channels.
use 5.006;
use strict;
+use warnings;
use Exporter;
use vars qw (@ISA @EXPORT);
diff --git a/lib/Autom4te/Channels.pm b/lib/Autom4te/Channels.pm
index 345fc357..ffe7361c 100644
--- a/lib/Autom4te/Channels.pm
+++ b/lib/Autom4te/Channels.pm
@@ -68,6 +68,7 @@ etc.) that can also be overridden on a per-message basis.
use 5.006;
use strict;
+use warnings;
use Exporter;
use Carp;
use File::Basename;
diff --git a/lib/Autom4te/Configure_ac.pm b/lib/Autom4te/Configure_ac.pm
index 93dae578..bf3ad99b 100644
--- a/lib/Autom4te/Configure_ac.pm
+++ b/lib/Autom4te/Configure_ac.pm
@@ -22,6 +22,7 @@ package Autom4te::Configure_ac;
use 5.006;
use strict;
+use warnings;
use Exporter;
use Autom4te::Channels;
use Autom4te::ChannelDefs;
diff --git a/lib/Autom4te/FileUtils.pm b/lib/Autom4te/FileUtils.pm
index 3920fd0b..7b7959f9 100644
--- a/lib/Autom4te/FileUtils.pm
+++ b/lib/Autom4te/FileUtils.pm
@@ -36,6 +36,7 @@ This perl module provides various general purpose file handling functions.
use 5.006;
use strict;
+use warnings;
use Exporter;
use File::stat;
use IO::File;
diff --git a/lib/Autom4te/General.pm b/lib/Autom4te/General.pm
index 4f397b0c..76dbd426 100644
--- a/lib/Autom4te/General.pm
+++ b/lib/Autom4te/General.pm
@@ -43,7 +43,7 @@ use File::stat;
use IO::File;
use Carp;
use strict;
-
+use warnings;
use vars qw (@ISA @EXPORT);
@ISA = qw (Exporter);
diff --git a/lib/Autom4te/Request.pm b/lib/Autom4te/Request.pm
index cf647361..5db75463 100644
--- a/lib/Autom4te/Request.pm
+++ b/lib/Autom4te/Request.pm
@@ -33,6 +33,7 @@ used in several executables of the Autoconf and Automake packages.
=cut
use strict;
+use warnings;
use Class::Struct;
use Carp;
use Data::Dumper;
diff --git a/lib/Autom4te/XFile.pm b/lib/Autom4te/XFile.pm
index b125a798..538d383b 100644
--- a/lib/Autom4te/XFile.pm
+++ b/lib/Autom4te/XFile.pm
@@ -71,6 +71,7 @@ and C<getlines> methods to translate C<\r\n> to C<\n>.
use 5.006;
use strict;
+use warnings;
use vars qw($VERSION @EXPORT @EXPORT_OK $AUTOLOAD @ISA);
use Carp;
use Errno;