This patch fixes two small bugs in cluster's "configure" script;
1. When checking the x.y.z kernel version values, it changes the '!$foo'
to 'not defined $foo'. This is because a version number of '0' matches
"not" (!$foo). A safer but slower approach would be to do '$foo =~
/^\d+$/'. Not sure which is preferred.
2. Added a check where if 'x' in 'x.y.z' is greater in the detected
kernel than in the minimum required kernel, the test passes. This
handles 3.x kernels where the minimum is 2.y.
I tested this patch against Fedora 16 x86-64 and Ubuntu 11.10 amd64.
--
Digimer
E-Mail: [email protected]
Freenode handle: digimer
Papers and Projects: http://alteeve.com
Node Assassin: http://nodeassassin.org
"omg my singularity battery is dead again.
stupid hawking radiation." - epitron
--- configure.orig 2011-12-02 00:20:04.513600907 -0500
+++ configure 2011-12-02 00:30:49.025600160 -0500
@@ -254,13 +254,14 @@
}
close MAKEFILE;
# Warn and continue if kernel version was not found
- if (!$build_version || !$build_patchlevel || !$build_sublevel) {
+ if (not defined $build_version || not defined $build_patchlevel || not defined $build_sublevel) {
print " WARNING: Could not determine kernel version.\n";
print " Build might fail!\n";
return 1;
}
# checking VERSION, PATCHLEVEL and SUBLEVEL for the supplied kernel
- if ($build_version >= $version[0] &&
+ if (($build_version > $version[0]) ||
+ $build_version == $version[0] &&
$build_patchlevel >= $version[1] &&
$build_sublevel >= $version[2]) {
print " Current kernel version appears to be OK\n";