]> git.ipfire.org Git - thirdparty/autoconf.git/commitdiff
perl: Replace -w option in shebangs with ‘use warnings’ in code
authorSerhii Popovych <spopovyc@cisco.com>
Wed, 10 Feb 2016 16:32:44 +0000 (16:32 +0000)
committerZack Weinberg <zackw@panix.com>
Mon, 31 Aug 2020 17:11:46 +0000 (13:11 -0400)
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.

13 files changed:
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/Request.pm
lib/Autom4te/XFile.pm

index d98998dedac53abbaf13d265853d1228a75b5b0b..0662767d91b143bcda097401f0c4a26be67ab8ff 100644 (file)
@@ -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@';
index 873ef7a45df36856be5a0f881e4a7777b04755dd..eea69da4e964f648e8c9a921b88a497e8c7f2160 100644 (file)
@@ -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.  ##
index 9780f7dbcca88837f52a8f5dd2041ac19d969521..0026c428535c7f6f7208d9f4850657f74551eeed 100644 (file)
@@ -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);
 
index 16b88abbdf8a3ade3ee70f128641163e1d1a41a4..af8dd55bbf80752ce20891b61c3eb1ed175664f6 100644 (file)
@@ -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@';
index c0c1f58b991327864ab1d529738ea132d7bcf938..f60d3a0f516385b2cdd381ad0f168ca877b93059 100644 (file)
@@ -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
 # -----
index 76486e6acc99454ebd063671d082156a60ed85fb..6226cd634e2a25d178ba2e07c0d752c3a4bf06f6 100644 (file)
@@ -35,6 +35,7 @@ use Data::Dumper;
 use Autom4te::Request;
 use Carp;
 use strict;
+use warnings;
 
 =over 4
 
index 7a93583f2b15687af1d1799b401a1b8e4a80da9e..c706b6dc8211369d545b68e3b0a478f234c67c81 100644 (file)
@@ -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);
index 345fc357d0333f206146edce0829db9077d67974..ffe7361cbce52e047533523bdecbf4c343a68431 100644 (file)
@@ -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;
index 93dae5782d7cfd06fc16c3c15d9fef70479da5f4..bf3ad99b75fcdebc5b24b3df065256b7a37dd593 100644 (file)
@@ -22,6 +22,7 @@ package Autom4te::Configure_ac;
 
 use 5.006;
 use strict;
+use warnings;
 use Exporter;
 use Autom4te::Channels;
 use Autom4te::ChannelDefs;
index 3920fd0bf72552631d0b420bab034753957435c8..7b7959f92263d5eb17dae752494afa1d17bf7656 100644 (file)
@@ -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;
index 4f397b0c4dd8fb01242b8f37ce89f51affb13691..76dbd42609821f2ba7c2004d46a02f7d7717392a 100644 (file)
@@ -43,7 +43,7 @@ use File::stat;
 use IO::File;
 use Carp;
 use strict;
-
+use warnings;
 use vars qw (@ISA @EXPORT);
 
 @ISA = qw (Exporter);
index cf6473615a772d402c1ee3ef74da7be4ea87b5d0..5db75463520e7ce1d5d5ca5b4fc9bfed6a16d454 100644 (file)
@@ -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;
index b125a7981eff7cd61069bc09f4d279ebbfae1782..538d383b0eed953acc1e296921efa898eb5df868 100644 (file)
@@ -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;