diff options
Diffstat (limited to 'scripts')
| -rwxr-xr-x | scripts/checkpatch.pl | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl index 6b409b0ad457..c00e5108c0d2 100755 --- a/scripts/checkpatch.pl +++ b/scripts/checkpatch.pl | |||
| @@ -37,6 +37,8 @@ my @ignore = (); | |||
| 37 | my $help = 0; | 37 | my $help = 0; |
| 38 | my $configuration_file = ".checkpatch.conf"; | 38 | my $configuration_file = ".checkpatch.conf"; |
| 39 | my $max_line_length = 80; | 39 | my $max_line_length = 80; |
| 40 | my $ignore_perl_version = 0; | ||
| 41 | my $minimum_perl_version = 5.10.0; | ||
| 40 | 42 | ||
| 41 | sub help { | 43 | sub help { |
| 42 | my ($exitcode) = @_; | 44 | my ($exitcode) = @_; |
| @@ -71,6 +73,8 @@ Options: | |||
| 71 | "<inputfile>.EXPERIMENTAL-checkpatch-fixes" | 73 | "<inputfile>.EXPERIMENTAL-checkpatch-fixes" |
| 72 | with potential errors corrected to the preferred | 74 | with potential errors corrected to the preferred |
| 73 | checkpatch style | 75 | checkpatch style |
| 76 | --ignore-perl-version override checking of perl version. expect | ||
| 77 | runtime errors. | ||
| 74 | -h, --help, --version display this help and exit | 78 | -h, --help, --version display this help and exit |
| 75 | 79 | ||
| 76 | When FILE is - read standard input. | 80 | When FILE is - read standard input. |
| @@ -123,6 +127,7 @@ GetOptions( | |||
| 123 | 'mailback!' => \$mailback, | 127 | 'mailback!' => \$mailback, |
| 124 | 'summary-file!' => \$summary_file, | 128 | 'summary-file!' => \$summary_file, |
| 125 | 'fix!' => \$fix, | 129 | 'fix!' => \$fix, |
| 130 | 'ignore-perl-version!' => \$ignore_perl_version, | ||
| 126 | 'debug=s' => \%debug, | 131 | 'debug=s' => \%debug, |
| 127 | 'test-only=s' => \$tst_only, | 132 | 'test-only=s' => \$tst_only, |
| 128 | 'h|help' => \$help, | 133 | 'h|help' => \$help, |
| @@ -133,6 +138,13 @@ help(0) if ($help); | |||
| 133 | 138 | ||
| 134 | my $exit = 0; | 139 | my $exit = 0; |
| 135 | 140 | ||
| 141 | if ($^V && $^V lt $minimum_perl_version) { | ||
| 142 | printf "$P: requires at least perl version %vd\n", $minimum_perl_version; | ||
| 143 | if (!$ignore_perl_version) { | ||
| 144 | exit(1); | ||
| 145 | } | ||
| 146 | } | ||
| 147 | |||
| 136 | if ($#ARGV < 0) { | 148 | if ($#ARGV < 0) { |
| 137 | print "$P: no input files\n"; | 149 | print "$P: no input files\n"; |
| 138 | exit(1); | 150 | exit(1); |
