Fix version comparison in precondition for firmware file check

svn path=/dists/trunk/linux-2.6/; revision=17571
This commit is contained in:
Ben Hutchings 2011-06-01 10:03:07 +00:00
parent b2c6024a6b
commit f7e1cc332e
1 changed files with 8 additions and 5 deletions

View File

@ -620,13 +620,16 @@ sub do_modules {
# for some other device, leading us to claim a dependency wrongly
if (!defined($ARGV[1]) || $ARGV[1] eq '') {
sub version_code {
my $version = shift;
$version =~ s/^2\.(\d+)\.(\d+).*/2*65536 + $1*256 + $2/e
or $version =~ s/^(\d+)\.(\d+).*/$1*65536 + $2*256/e
or $version = 0;
return $version;
}
(undef, undef, my $running_version) = POSIX::uname();
my $running_patchlevel = $running_version;
$running_patchlevel =~ s/^2\.6\.(\d+).*/$1/;
my $new_patchlevel = $version;
$new_patchlevel =~ s/^2\.6\.(\d+).*/$1/;
if ($new_patchlevel > $running_patchlevel) {
if (version_code($new_version) > version_code($running_version)) {
my $missing = '';
my %module_paths;
open(DEP, "<$modules_base/$version/modules.dep") or return;