aboutsummaryrefslogtreecommitdiffstats
path: root/scripts/checkversion.pl
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2010-06-01 11:55:52 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2010-06-01 11:55:52 -0400
commit1f73897861b8ef0be64ff4b801f8d6f830f683b5 (patch)
treeb4bae8f12e1422113910d8cb00a19d010dc4a52f /scripts/checkversion.pl
parentb904d7131d116900524bd36ec170dcd97846bfd3 (diff)
parent64ffc9ff424c65adcffe7d590018cc75e2d5d42a (diff)
Merge branch 'for-35' of git://repo.or.cz/linux-kbuild
* 'for-35' of git://repo.or.cz/linux-kbuild: (81 commits) kbuild: Revert part of e8d400a to resolve a conflict kbuild: Fix checking of scm-identifier variable gconfig: add support to show hidden options that have prompts menuconfig: add support to show hidden options which have prompts gconfig: remove show_debug option gconfig: remove dbg_print_ptype() and dbg_print_stype() kconfig: fix zconfdump() kconfig: some small fixes add random binaries to .gitignore kbuild: Include gen_initramfs_list.sh and the file list in the .d file kconfig: recalc symbol value before showing search results .gitignore: ignore *.lzo files headerdep: perlcritic warning scripts/Makefile.lib: Align the output of LZO kbuild: Generate modules.builtin in make modules_install Revert "kbuild: specify absolute paths for cscope" kbuild: Do not unnecessarily regenerate modules.builtin headers_install: use local file handles headers_check: fix perl warnings export_report: fix perl warnings ...
Diffstat (limited to 'scripts/checkversion.pl')
-rwxr-xr-xscripts/checkversion.pl23
1 files changed, 11 insertions, 12 deletions
diff --git a/scripts/checkversion.pl b/scripts/checkversion.pl
index ec7d21161bdc..b444e89a0095 100755
--- a/scripts/checkversion.pl
+++ b/scripts/checkversion.pl
@@ -5,23 +5,22 @@
5# including <linux/version.h> that don't need it. 5# including <linux/version.h> that don't need it.
6# Copyright (C) 2003, Randy Dunlap <rdunlap@xenotime.net> 6# Copyright (C) 2003, Randy Dunlap <rdunlap@xenotime.net>
7 7
8use strict;
9
8$| = 1; 10$| = 1;
9 11
10my $debugging = 0; 12my $debugging;
11 13
12foreach $file (@ARGV) 14foreach my $file (@ARGV) {
13{
14 # Open this file. 15 # Open this file.
15 open(FILE, $file) || die "Can't open $file: $!\n"; 16 open( my $f, '<', $file )
17 or die "Can't open $file: $!\n";
16 18
17 # Initialize variables. 19 # Initialize variables.
18 my $fInComment = 0; 20 my ($fInComment, $fInString, $fUseVersion);
19 my $fInString = 0;
20 my $fUseVersion = 0;
21 my $iLinuxVersion = 0; 21 my $iLinuxVersion = 0;
22 22
23 LINE: while ( <FILE> ) 23 while (<$f>) {
24 {
25 # Strip comments. 24 # Strip comments.
26 $fInComment && (s+^.*?\*/+ +o ? ($fInComment = 0) : next); 25 $fInComment && (s+^.*?\*/+ +o ? ($fInComment = 0) : next);
27 m+/\*+o && (s+/\*.*?\*/+ +go, (s+/\*.*$+ +o && ($fInComment = 1))); 26 m+/\*+o && (s+/\*.*?\*/+ +go, (s+/\*.*$+ +o && ($fInComment = 1)));
@@ -43,8 +42,8 @@ foreach $file (@ARGV)
43 # Look for uses: LINUX_VERSION_CODE, KERNEL_VERSION, UTS_RELEASE 42 # Look for uses: LINUX_VERSION_CODE, KERNEL_VERSION, UTS_RELEASE
44 if (($_ =~ /LINUX_VERSION_CODE/) || ($_ =~ /\WKERNEL_VERSION/)) { 43 if (($_ =~ /LINUX_VERSION_CODE/) || ($_ =~ /\WKERNEL_VERSION/)) {
45 $fUseVersion = 1; 44 $fUseVersion = 1;
46 last LINE if $iLinuxVersion; 45 last if $iLinuxVersion;
47 } 46 }
48 } 47 }
49 48
50 # Report used version IDs without include? 49 # Report used version IDs without include?
@@ -67,5 +66,5 @@ foreach $file (@ARGV)
67 } 66 }
68 } 67 }
69 68
70 close(FILE); 69 close($f);
71} 70}