From 90b17aef1a43717f8813aa088564950cc06650b8 Mon Sep 17 00:00:00 2001 From: Andrea Bolognani Date: Mon, 18 Sep 2017 14:35:50 +0200 Subject: [PATCH] perl: Don't hardcode interpreter path This is particularly useful on operating systems that don't ship Perl as part of the base system (eg. FreeBSD) while still working just as well as it did before on Linux. In one case (src/rpc/genprotocol.pl) the interpreter path was missing altogether. Signed-off-by: Andrea Bolognani --- build-aux/augeas-gentest.pl | 2 +- build-aux/check-spacing.pl | 2 +- build-aux/mock-noinline.pl | 2 +- build-aux/prohibit-duplicate-header.pl | 2 +- docs/genaclperms.pl | 2 +- docs/hvsupport.pl | 2 +- src/access/genpolkit.pl | 2 +- src/check-aclperms.pl | 2 +- src/check-aclrules.pl | 2 +- src/check-driverimpls.pl | 2 +- src/check-drivername.pl | 2 +- src/check-symfile.pl | 2 +- src/check-symsorting.pl | 2 +- src/dtrace2systemtap.pl | 2 +- src/rpc/gendispatch.pl | 3 ++- src/rpc/genprotocol.pl | 1 + src/rpc/gensystemtap.pl | 2 +- tests/check-file-access.pl | 2 +- tests/oomtrace.pl | 2 +- 19 files changed, 20 insertions(+), 18 deletions(-) diff --git a/build-aux/augeas-gentest.pl b/build-aux/augeas-gentest.pl index ece9a8a00d..18a1c5bce3 100755 --- a/build-aux/augeas-gentest.pl +++ b/build-aux/augeas-gentest.pl @@ -1,4 +1,4 @@ -#!/usr/bin/perl +#!/usr/bin/env perl # # augeas-gentest.pl: Generate an augeas test file, from an # example config file + test file template diff --git a/build-aux/check-spacing.pl b/build-aux/check-spacing.pl index 448acf2345..ca8b434916 100755 --- a/build-aux/check-spacing.pl +++ b/build-aux/check-spacing.pl @@ -1,4 +1,4 @@ -#!/usr/bin/perl +#!/usr/bin/env perl # # check-spacing.pl: Report any usage of 'function (..args..)' # Also check for other syntax issues, such as correct use of ';' diff --git a/build-aux/mock-noinline.pl b/build-aux/mock-noinline.pl index eafe20d2e2..c6b40001c5 100644 --- a/build-aux/mock-noinline.pl +++ b/build-aux/mock-noinline.pl @@ -1,4 +1,4 @@ -#!/usr/bin/perl +#!/usr/bin/env perl my %noninlined; my %mocked; diff --git a/build-aux/prohibit-duplicate-header.pl b/build-aux/prohibit-duplicate-header.pl index f0539aeca5..4a2ea65665 100644 --- a/build-aux/prohibit-duplicate-header.pl +++ b/build-aux/prohibit-duplicate-header.pl @@ -1,4 +1,4 @@ -#!/usr/bin/perl +#!/usr/bin/env perl use strict; diff --git a/docs/genaclperms.pl b/docs/genaclperms.pl index c0514a0229..d878321a90 100755 --- a/docs/genaclperms.pl +++ b/docs/genaclperms.pl @@ -1,4 +1,4 @@ -#!/usr/bin/perl +#!/usr/bin/env perl # # Copyright (C) 2013 Red Hat, Inc. # diff --git a/docs/hvsupport.pl b/docs/hvsupport.pl index edbe19faf6..fc6eb1f152 100755 --- a/docs/hvsupport.pl +++ b/docs/hvsupport.pl @@ -1,4 +1,4 @@ -#!/usr/bin/perl +#!/usr/bin/env perl use strict; use warnings; diff --git a/src/access/genpolkit.pl b/src/access/genpolkit.pl index eb7069a6d1..6258fd3a1e 100755 --- a/src/access/genpolkit.pl +++ b/src/access/genpolkit.pl @@ -1,4 +1,4 @@ -#!/usr/bin/perl +#!/usr/bin/env perl # # Copyright (C) 2012-2013 Red Hat, Inc. # diff --git a/src/check-aclperms.pl b/src/check-aclperms.pl index 5b1b4dbad3..55b6598313 100755 --- a/src/check-aclperms.pl +++ b/src/check-aclperms.pl @@ -1,4 +1,4 @@ -#!/usr/bin/perl +#!/usr/bin/env perl # # Copyright (C) 2013 Red Hat, Inc. # diff --git a/src/check-aclrules.pl b/src/check-aclrules.pl index 8739cda730..5b6c711dc8 100755 --- a/src/check-aclrules.pl +++ b/src/check-aclrules.pl @@ -1,4 +1,4 @@ -#!/usr/bin/perl +#!/usr/bin/env perl # # Copyright (C) 2013-2014 Red Hat, Inc. # diff --git a/src/check-driverimpls.pl b/src/check-driverimpls.pl index e32055835a..4c28f2092a 100755 --- a/src/check-driverimpls.pl +++ b/src/check-driverimpls.pl @@ -1,4 +1,4 @@ -#!/usr/bin/perl +#!/usr/bin/env perl # # Copyright (C) 2013 Red Hat, Inc. # diff --git a/src/check-drivername.pl b/src/check-drivername.pl index 5c8de0aa11..3a62193e33 100755 --- a/src/check-drivername.pl +++ b/src/check-drivername.pl @@ -1,4 +1,4 @@ -#!/usr/bin/perl +#!/usr/bin/env perl # # Copyright (C) 2013 Red Hat, Inc. # diff --git a/src/check-symfile.pl b/src/check-symfile.pl index d59a213eba..4f88300864 100755 --- a/src/check-symfile.pl +++ b/src/check-symfile.pl @@ -1,4 +1,4 @@ -#!/usr/bin/perl +#!/usr/bin/env perl # Copyright (C) 2012-2013 Red Hat, Inc. # diff --git a/src/check-symsorting.pl b/src/check-symsorting.pl index 81265e04d7..51e38bdedb 100755 --- a/src/check-symsorting.pl +++ b/src/check-symsorting.pl @@ -1,4 +1,4 @@ -#!/usr/bin/perl +#!/usr/bin/env perl # Copyright (C) 2012-2013 Red Hat, Inc. # diff --git a/src/dtrace2systemtap.pl b/src/dtrace2systemtap.pl index 19d980564c..92c76a66eb 100755 --- a/src/dtrace2systemtap.pl +++ b/src/dtrace2systemtap.pl @@ -1,4 +1,4 @@ -#!/usr/bin/perl +#!/usr/bin/env perl # # Copyright (C) 2011-2012 Red Hat, Inc. # diff --git a/src/rpc/gendispatch.pl b/src/rpc/gendispatch.pl index e7a48d578a..fb15cc4849 100755 --- a/src/rpc/gendispatch.pl +++ b/src/rpc/gendispatch.pl @@ -1,4 +1,4 @@ -#!/usr/bin/perl -w +#!/usr/bin/env perl # # Copyright (C) 2010-2015 Red Hat, Inc. # @@ -32,6 +32,7 @@ # Extended by Matthias Bolte use strict; +use warnings; use Getopt::Long; diff --git a/src/rpc/genprotocol.pl b/src/rpc/genprotocol.pl index 69d20a3447..6ce268c024 100755 --- a/src/rpc/genprotocol.pl +++ b/src/rpc/genprotocol.pl @@ -1,3 +1,4 @@ +#!/usr/bin/env perl # # Generate code for an XDR protocol, optionally applying # fixups to the glibc rpcgen code so that it compiles diff --git a/src/rpc/gensystemtap.pl b/src/rpc/gensystemtap.pl index 7b80fbf838..c0d3435096 100755 --- a/src/rpc/gensystemtap.pl +++ b/src/rpc/gensystemtap.pl @@ -1,4 +1,4 @@ -#!/usr/bin/perl +#!/usr/bin/env perl # # Copyright (C) 2011-2012 Red Hat, Inc. # diff --git a/tests/check-file-access.pl b/tests/check-file-access.pl index 0c75ae9984..977a2bc533 100755 --- a/tests/check-file-access.pl +++ b/tests/check-file-access.pl @@ -1,4 +1,4 @@ -#!/usr/bin/perl -w +#!/usr/bin/env perl # # Copyright (C) 2016 Red Hat, Inc. # diff --git a/tests/oomtrace.pl b/tests/oomtrace.pl index 6d423e796a..f799262f2c 100755 --- a/tests/oomtrace.pl +++ b/tests/oomtrace.pl @@ -1,4 +1,4 @@ -#!/usr/bin/perl +#!/usr/bin/env perl use strict; use warnings;