History

scripts: Switch to more portable Perl shebang

The default NetBSD package manager is pkgsrc and it installs Perl along other third party programs under custom and configurable prefix. The default prefix for binary prebuilt packages is /usr/pkg, and the Perl executable lands in /usr/pkg/bin/perl. This change switches "/usr/bin/perl" to "/usr/bin/env perl" as it's the most portable solution that should work for almost everybody. Perl's executable is detected automatically. This change switches -w option passed to the executable with more modern "use warnings;" approach. There is no functional change to the default behavior. While there, drop "require 5" from scripts/namespace.pl (Perl from 1994?).

Kamil Rytarowski committed 9 years ago

Commit cb77f0d1 parent 2ea659a24 files · +37 −25Browse files

Unified · Split

24 files
  1. scripts/bootgraph.pl +1 −1
  2. scripts/checkincludes.pl +1 −1
  3. scripts/checkpatch.pl +2 −1
  4. scripts/checkstack.pl +1 −1
  5. scripts/checkversion.pl +1 −1
  6. scripts/cleanfile +2 −1
  7. scripts/cleanpatch +2 −1
  8. scripts/dtc/dt_to_config +1 −1
  9. scripts/export_report.pl +2 −1
  10. scripts/extract-module-sig.pl +2 −1
  11. scripts/extract-sys-certs.pl +2 −1
  12. scripts/extract_xc3028.pl +1 −1
  13. scripts/get_dvb_firmware +1 −1
  14. scripts/get_maintainer.pl +2 −1
  15. scripts/headerdep.pl +1 −1
  16. scripts/headers_check.pl +2 −1
  17. scripts/kconfig/streamline_config.pl +2 −1
  18. scripts/kernel-doc +2 −1
  19. scripts/kernel-doc-xml-ref +2 −1
  20. scripts/markup_oops.pl +1 −1
  21. scripts/namespace.pl +2 −2
  22. scripts/profile2linkerlist.pl +1 −1
  23. scripts/recordmcount.pl +2 −1
  24. scripts/stackdelta +1 −1
scripts/bootgraph.pl+1−1
@@ -1,4 +1,4 @@
1−#!/usr/bin/perl
1+#!/usr/bin/env perl
22
33 # Copyright 2008, Intel Corporation
44 #
scripts/checkincludes.pl+1−1
@@ -1,4 +1,4 @@
1−#!/usr/bin/perl
1+#!/usr/bin/env perl
22 #
33 # checkincludes: find/remove files included more than once
44 #
scripts/checkpatch.pl+2−1
@@ -1,4 +1,4 @@
1−#!/usr/bin/perl -w
1+#!/usr/bin/env perl
22 # (c) 2001, Dave Jones. (the file handling bit)
33 # (c) 2005, Joel Schopp <jschopp@austin.ibm.com> (the ugly bit)
44 # (c) 2007,2008, Andy Whitcroft <apw@uk.ibm.com> (new conditions, test suite)
@@ -6,6 +6,7 @@ · 1 unmodified line
66 # Licensed under the terms of the GNU GPL License version 2
77
88 use strict;
9+use warnings;
910 use POSIX;
1011 use File::Basename;
1112 use Cwd 'abs_path';
scripts/checkstack.pl+1−1
@@ -1,4 +1,4 @@
1−#!/usr/bin/perl
1+#!/usr/bin/env perl
22
33 # Check the stack usage of functions
44 #
scripts/checkversion.pl+1−1
@@ -1,4 +1,4 @@
1−#! /usr/bin/perl
1+#! /usr/bin/env perl
22 #
33 # checkversion find uses of LINUX_VERSION_CODE or KERNEL_VERSION
44 # without including <linux/version.h>, or cases of
scripts/cleanfile+2−1
@@ -1,9 +1,10 @@
1−#!/usr/bin/perl -w
1+#!/usr/bin/env perl
22 #
33 # Clean a text file -- or directory of text files -- of stealth whitespace.
44 # WARNING: this can be a highly destructive operation. Use with caution.
55 #
66
7+use warnings;
78 use bytes;
89 use File::Basename;
910
scripts/cleanpatch+2−1
@@ -1,9 +1,10 @@
1−#!/usr/bin/perl -w
1+#!/usr/bin/env perl
22 #
33 # Clean a patch file -- or directory of patch files -- of stealth whitespace.
44 # WARNING: this can be a highly destructive operation. Use with caution.
55 #
66
7+use warnings;
78 use bytes;
89 use File::Basename;
910
scripts/dtc/dt_to_config+1−1
@@ -1,4 +1,4 @@
1−#!/usr/bin/perl
1+#!/usr/bin/env perl
22
33 # Copyright 2016 by Frank Rowand
44 # Copyright 2016 by Gaurav Minocha
scripts/export_report.pl+2−1
@@ -1,4 +1,4 @@
1−#!/usr/bin/perl -w
1+#!/usr/bin/env perl
22 #
33 # (C) Copyright IBM Corporation 2006.
44 # Released under GPL v2.
@@ -7,6 +7,7 @@ · 2 unmodified lines
77 # Usage: export_report.pl -k Module.symvers [-o report_file ] -f *.mod.c
88 #
99
10+use warnings;
1011 use Getopt::Std;
1112 use strict;
1213
scripts/extract-module-sig.pl+2−1
@@ -1,4 +1,4 @@
1−#!/usr/bin/perl -w
1+#!/usr/bin/env perl
22 #
33 # extract-mod-sig <part> <module-file>
44 #
@@ -12,6 +12,7 @@ · 7 unmodified lines
1212 # -k: Just the key ID
1313 # -s: Just the crypto signature or PKCS#7 message
1414 #
15+use warnings;
1516 use strict;
1617
1718 die "Format: $0 -[0adnks] module-file >out\n"
scripts/extract-sys-certs.pl+2−1
@@ -1,5 +1,6 @@
1−#!/usr/bin/perl -w
1+#!/usr/bin/env perl
22 #
3+use warnings;
34 use strict;
45 use Math::BigInt;
56 use Fcntl "SEEK_SET";
scripts/extract_xc3028.pl+1−1
@@ -1,4 +1,4 @@
1−#!/usr/bin/perl
1+#!/usr/bin/env perl
22
33 # Copyright (c) Mauro Carvalho Chehab <mchehab@infradead.org>
44 # Released under GPLv2
scripts/get_dvb_firmware+1−1
@@ -1,4 +1,4 @@
1−#!/usr/bin/perl
1+#!/usr/bin/env perl
22 # DVB firmware extractor
33 #
44 # (c) 2004 Andrew de Quincey
scripts/get_maintainer.pl+2−1
@@ -1,4 +1,4 @@
1−#!/usr/bin/perl -w
1+#!/usr/bin/env perl
22 # (c) 2007, Joe Perches <joe@perches.com>
33 # created from checkpatch.pl
44 #
@@ -10,6 +10,7 @@ · 5 unmodified lines
1010 #
1111 # Licensed under the terms of the GNU GPL License version 2
1212
13+use warnings;
1314 use strict;
1415
1516 my $P = $0;
scripts/headerdep.pl+1−1
@@ -1,4 +1,4 @@
1−#! /usr/bin/perl
1+#! /usr/bin/env perl
22 #
33 # Detect cycles in the header file dependency graph
44 # Vegard Nossum <vegardno@ifi.uio.no>
scripts/headers_check.pl+2−1
@@ -1,4 +1,4 @@
1−#!/usr/bin/perl -w
1+#!/usr/bin/env perl
22 #
33 # headers_check.pl execute a number of trivial consistency checks
44 #
@@ -18,6 +18,7 @@ · 13 unmodified lines
1818 #
1919 # 3) Check for leaked CONFIG_ symbols
2020
21+use warnings;
2122 use strict;
2223 use File::Basename;
2324
scripts/kconfig/streamline_config.pl+2−1
@@ -1,4 +1,4 @@
1−#!/usr/bin/perl -w
1+#!/usr/bin/env perl
22 #
33 # Copyright 2005-2009 - Steven Rostedt
44 # Licensed under the terms of the GNU GPL License version 2
@@ -42,6 +42,7 @@ · 37 unmodified lines
4242 # mv config_strip .config
4343 # make oldconfig
4444 #
45+use warnings;
4546 use strict;
4647 use Getopt::Long;
4748
scripts/kernel-doc+2−1
@@ -1,5 +1,6 @@
1−#!/usr/bin/perl -w
1+#!/usr/bin/env perl
22
3+use warnings;
34 use strict;
45
56 ## Copyright (c) 1998 Michael Zucchi, All Rights Reserved ##
scripts/kernel-doc-xml-ref+2−1
@@ -1,5 +1,6 @@
1−#!/usr/bin/perl -w
1+#!/usr/bin/env perl
22
3+use warnings;
34 use strict;
45
56 ## Copyright (C) 2015 Intel Corporation ##
scripts/markup_oops.pl+1−1
@@ -1,4 +1,4 @@
1−#!/usr/bin/perl
1+#!/usr/bin/env perl
22
33 use File::Basename;
44 use Math::BigInt;
scripts/namespace.pl+2−2
@@ -1,4 +1,4 @@
1−#!/usr/bin/perl -w
1+#!/usr/bin/env perl
22 #
33 # namespace.pl. Mon Aug 30 2004
44 #
@@ -62,7 +62,7 @@ · 57 unmodified lines
6262 # result.
6363 #
6464
65−require 5; # at least perl 5
65+use warnings;
6666 use strict;
6767 use File::Find;
6868
scripts/profile2linkerlist.pl+1−1
@@ -1,4 +1,4 @@
1−#!/usr/bin/perl
1+#!/usr/bin/env perl
22
33 #
44 # Takes a (sorted) output of readprofile and turns it into a list suitable for
scripts/recordmcount.pl+2−1
@@ -1,4 +1,4 @@
1−#!/usr/bin/perl -w
1+#!/usr/bin/env perl
22 # (c) 2008, Steven Rostedt <srostedt@redhat.com>
33 # Licensed under the terms of the GNU GPL License version 2
44 #
@@ -106,6 +106,7 @@ · 101 unmodified lines
106106 # 9) Move the result back to the original object.
107107 #
108108
109+use warnings;
109110 use strict;
110111
111112 my $P = $0;
scripts/stackdelta+1−1
@@ -1,4 +1,4 @@
1−#!/usr/bin/perl
1+#!/usr/bin/env perl
22
33 # Read two files produced by the stackusage script, and show the
44 # delta between them.