X-Git-Url: https://git.karo-electronics.de/?a=blobdiff_plain;f=scripts%2Fcheckversion.pl;h=b444e89a0095dc16d207fb23a7600a148c67834b;hb=f451171c5ac829e55581c81caf2cb01e1c0a5c5f;hp=ec7d21161bdcb873ee38926c4097a23b44702880;hpb=aef8755711a28bb0ecde7780ae6613fcb62cf6f7;p=mv-sheeva.git diff --git a/scripts/checkversion.pl b/scripts/checkversion.pl index ec7d21161bd..b444e89a009 100755 --- a/scripts/checkversion.pl +++ b/scripts/checkversion.pl @@ -5,23 +5,22 @@ # including that don't need it. # Copyright (C) 2003, Randy Dunlap +use strict; + $| = 1; -my $debugging = 0; +my $debugging; -foreach $file (@ARGV) -{ +foreach my $file (@ARGV) { # Open this file. - open(FILE, $file) || die "Can't open $file: $!\n"; + open( my $f, '<', $file ) + or die "Can't open $file: $!\n"; # Initialize variables. - my $fInComment = 0; - my $fInString = 0; - my $fUseVersion = 0; + my ($fInComment, $fInString, $fUseVersion); my $iLinuxVersion = 0; - LINE: while ( ) - { + while (<$f>) { # Strip comments. $fInComment && (s+^.*?\*/+ +o ? ($fInComment = 0) : next); m+/\*+o && (s+/\*.*?\*/+ +go, (s+/\*.*$+ +o && ($fInComment = 1))); @@ -43,8 +42,8 @@ foreach $file (@ARGV) # Look for uses: LINUX_VERSION_CODE, KERNEL_VERSION, UTS_RELEASE if (($_ =~ /LINUX_VERSION_CODE/) || ($_ =~ /\WKERNEL_VERSION/)) { $fUseVersion = 1; - last LINE if $iLinuxVersion; - } + last if $iLinuxVersion; + } } # Report used version IDs without include? @@ -67,5 +66,5 @@ foreach $file (@ARGV) } } - close(FILE); + close($f); }