Skip to content

Commit cb77f0d

Browse files
krytarowskimasahir0y
authored andcommitted
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?). Signed-off-by: Kamil Rytarowski <[email protected]> Signed-off-by: Masahiro Yamada <[email protected]>
1 parent 2ea659a commit cb77f0d

24 files changed

+37
-25
lines changed

Diff for: scripts/bootgraph.pl

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#!/usr/bin/perl
1+
#!/usr/bin/env perl
22

33
# Copyright 2008, Intel Corporation
44
#

Diff for: scripts/checkincludes.pl

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#!/usr/bin/perl
1+
#!/usr/bin/env perl
22
#
33
# checkincludes: find/remove files included more than once
44
#

Diff for: scripts/checkpatch.pl

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
1-
#!/usr/bin/perl -w
1+
#!/usr/bin/env perl
22
# (c) 2001, Dave Jones. (the file handling bit)
33
# (c) 2005, Joel Schopp <[email protected]> (the ugly bit)
44
# (c) 2007,2008, Andy Whitcroft <[email protected]> (new conditions, test suite)
55
# (c) 2008-2010 Andy Whitcroft <[email protected]>
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';

Diff for: scripts/checkstack.pl

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#!/usr/bin/perl
1+
#!/usr/bin/env perl
22

33
# Check the stack usage of functions
44
#

Diff for: scripts/checkversion.pl

+1-1
Original file line numberDiff line numberDiff line change
@@ -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

Diff for: scripts/cleanfile

+2-1
Original file line numberDiff line numberDiff line change
@@ -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

Diff for: scripts/cleanpatch

+2-1
Original file line numberDiff line numberDiff line change
@@ -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

Diff for: scripts/dtc/dt_to_config

+1-1
Original file line numberDiff line numberDiff line change
@@ -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

Diff for: scripts/export_report.pl

+2-1
Original file line numberDiff line numberDiff line change
@@ -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 @@
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

Diff for: scripts/extract-module-sig.pl

+2-1
Original file line numberDiff line numberDiff line change
@@ -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 @@
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"

Diff for: scripts/extract-sys-certs.pl

+2-1
Original file line numberDiff line numberDiff line change
@@ -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";

Diff for: scripts/extract_xc3028.pl

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#!/usr/bin/perl
1+
#!/usr/bin/env perl
22

33
# Copyright (c) Mauro Carvalho Chehab <[email protected]>
44
# Released under GPLv2

Diff for: scripts/get_dvb_firmware

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#!/usr/bin/perl
1+
#!/usr/bin/env perl
22
# DVB firmware extractor
33
#
44
# (c) 2004 Andrew de Quincey

Diff for: scripts/get_maintainer.pl

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#!/usr/bin/perl -w
1+
#!/usr/bin/env perl
22
# (c) 2007, Joe Perches <[email protected]>
33
# created from checkpatch.pl
44
#
@@ -10,6 +10,7 @@
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;

Diff for: scripts/headerdep.pl

+1-1
Original file line numberDiff line numberDiff line change
@@ -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 <[email protected]>

Diff for: scripts/headers_check.pl

+2-1
Original file line numberDiff line numberDiff line change
@@ -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 @@
1818
#
1919
# 3) Check for leaked CONFIG_ symbols
2020

21+
use warnings;
2122
use strict;
2223
use File::Basename;
2324

Diff for: scripts/kconfig/streamline_config.pl

+2-1
Original file line numberDiff line numberDiff line change
@@ -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 @@
4242
# mv config_strip .config
4343
# make oldconfig
4444
#
45+
use warnings;
4546
use strict;
4647
use Getopt::Long;
4748

Diff for: scripts/kernel-doc

+2-1
Original file line numberDiff line numberDiff line change
@@ -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 ##

Diff for: scripts/kernel-doc-xml-ref

+2-1
Original file line numberDiff line numberDiff line change
@@ -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 ##

Diff for: scripts/markup_oops.pl

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#!/usr/bin/perl
1+
#!/usr/bin/env perl
22

33
use File::Basename;
44
use Math::BigInt;

Diff for: scripts/namespace.pl

+2-2
Original file line numberDiff line numberDiff line change
@@ -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 @@
6262
# result.
6363
#
6464

65-
require 5; # at least perl 5
65+
use warnings;
6666
use strict;
6767
use File::Find;
6868

Diff for: scripts/profile2linkerlist.pl

+1-1
Original file line numberDiff line numberDiff line change
@@ -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

Diff for: scripts/recordmcount.pl

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#!/usr/bin/perl -w
1+
#!/usr/bin/env perl
22
# (c) 2008, Steven Rostedt <[email protected]>
33
# Licensed under the terms of the GNU GPL License version 2
44
#
@@ -106,6 +106,7 @@
106106
# 9) Move the result back to the original object.
107107
#
108108

109+
use warnings;
109110
use strict;
110111

111112
my $P = $0;

Diff for: scripts/stackdelta

+1-1
Original file line numberDiff line numberDiff line change
@@ -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.

0 commit comments

Comments
 (0)