From: <sis...@sy...> - 2007-01-25 18:30:20
|
Author: arighi Date: 2007-01-25 12:30:05 -0600 (Thu, 25 Jan 2007) New Revision: 3875 Modified: trunk/lib/SystemImager/UseYourOwnKernel.pm Log: fix: get the first occurrence of the kernel string (not the last) Modified: trunk/lib/SystemImager/UseYourOwnKernel.pm =================================================================== --- trunk/lib/SystemImager/UseYourOwnKernel.pm 2007-01-24 20:04:02 UTC (rev 3874) +++ trunk/lib/SystemImager/UseYourOwnKernel.pm 2007-01-25 18:30:05 UTC (rev 3875) @@ -399,6 +399,7 @@ my $uname_r; $cmd = "$cat $file"; open(IN,"$cmd |") or die("Couldn't $cmd: $!"); + binmode(IN); # # Example entries like what we're trying to match against in kernels: # 2.6.10bef1 (finley@mantis) #1 Tue Mar 1 00:37:55 CST 2005 @@ -412,6 +413,7 @@ # extract the `uname -r` string from the kernel file if(m/$regex/o) { $uname_r = $1; + last; } } close(IN); |