This is the mail archive of the cluster-cvs@sourceware.org mailing list for the cluster.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Cluster Project branch, STABLE2, updated. cluster-2.03.01-14-g523acee


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Cluster Project".

http://sources.redhat.com/git/gitweb.cgi?p=cluster.git;a=commitdiff;h=523acee2a3aa7340acc04a28e43164f090b615df

The branch, STABLE2 has been updated
       via  523acee2a3aa7340acc04a28e43164f090b615df (commit)
      from  c58f0a46f6b06b0cf0b09dad2c3114fe5742a489 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 523acee2a3aa7340acc04a28e43164f090b615df
Author: Fabio M. Di Nitto <fdinitto@redhat.com>
Date:   Fri Apr 25 09:01:14 2008 +0200

    [BUILD] Fix kernel check for good
    
    Use the top level Makefile of the source tree rather than
    random includes that keeps changing.
    
    Signed-off-by: Fabio M. Di Nitto <fdinitto@redhat.com>

-----------------------------------------------------------------------

Summary of changes:
 configure |   55 +++++++++++++++++--------------------------------------
 1 files changed, 17 insertions(+), 38 deletions(-)

diff --git a/configure b/configure
index 2501059..9160e10 100755
--- a/configure
+++ b/configure
@@ -236,64 +236,43 @@ if ($help || !$err) {
 }
 
 sub kernel_version {
-  my $autoconf_path = shift;
+  my $makefile_path = shift;
   my $required_version = shift;
-  my $build_version = 0;
-  my $build_patchlevel = 0;
-  my $build_sublevel = 0;
 
   print "\nChecking kernel:\n";
 
   # add autoconf to the path
-  $autoconf_path .= '/include/linux/autoconf.h';
+  $makefile_path .= '/Makefile';
   my @version = split /\./, $required_version;
-  my $current_version = 0;
-  if ( -f $autoconf_path ) {
-    # open the autoconf.h to feth VERSION, PATCHLEVEL and SUBLEVEL, if needed I can add EXTRAVERSION too
-    open AUTOCONF, '<', $autoconf_path;
-    while (<AUTOCONF>) {
-      if ($_ =~ /CONFIG_KERNELVERSION/) {
-        $current_version = $_;
-        # we don't need to check any thing else in this file so we are stopping the read
-        last;
-      }
+  if ( -f $makefile_path ) {
+    # open the toplevel Makefile to feth VERSION, PATCHLEVEL and SUBLEVEL
+    open MAKEFILE, '<', $makefile_path;
+    while (<MAKEFILE>) {
+      $build_version = $1 if /^VERSION = (\d+)/;
+      $build_patchlevel = $1 if /^PATCHLEVEL = (\d+)/;
+      $build_sublevel = $1 if /^SUBLEVEL = (\d+)/;
+      last if (defined $build_version && defined $build_patchlevel && defined $build_sublevel);
     }
-    close AUTOCONF;
-    # Warn and continue if CONFIG_KERNELVERSION was not found
-    if (!$current_version) {
+    close MAKEFILE;
+    # Warn and continue if kernel version was not found
+    if (!$build_version || !$build_patchlevel || !$build_sublevel) {
 	print " WARNING: Could not determine kernel version.\n";
+	print "          Build might fail!\n";
 	return 1;
     }
-    # leaving only the numbers from the lines
-    # this is faster then split and doesn't alocate useless arrays
-    $current_version =~ s/.*"(.*)"\n/$1/;
-    # parse the kernel version into the variables
-    if ($current_version =~ /\-/) {
-        my @line = split /\-/, $current_version;
-        my @ver  = split /\./, $line[0];
-        $build_version = $ver[0];
-        $build_patchlevel = $ver[1];
-        $build_sublevel = $ver[2];
-    } else {
-        my @kernel = split /\./, $current_version;
-        $build_version = $kernel[0];
-        $build_patchlevel = $kernel[1];
-        $build_sublevel = $kernel[2];
-    }
     # checking VERSION, PATCHLEVEL and SUBLEVEL for the supplied kernel
-    # if needed I can add also EXTRAVERSION to the check
     if ($build_version >= $version[0] &&
         $build_patchlevel >= $version[1] &&
         $build_sublevel >= $version[2]) {
       print " Current kernel version appears to be OK\n";
       return 1;
     } else {
-      print " Current kernel version: ",$current_version,"\n Minimum kernel version: ",$required_version,"\n";
+      print " Current kernel version: ",$build_version, "." , $build_patchlevel, ".", $build_sublevel, "\n Minimum kernel version: ",$required_version,"\n";
       print " FAILED!\n";
       return 0;
     }
   } else {
-    print " Unable to find ($autoconf_path)!\n";
+    print " Unable to find ($makefile_path)!\n";
     print " Make sure that:\n - the above path is correct\n";
     print " - your kernel is properly configured and prepared.\n";
     print " - kernel_build and kernel_src options to configure are set properly.\n";
@@ -385,7 +364,7 @@ if (!$kernel_src) {
     $kernel_src=$kernel_build;
   }
 }
-if (not $disable_kernel_check and !kernel_version($kernel_build,$required_kernelversion)) {
+if (not $disable_kernel_check and !kernel_version($kernel_src,$required_kernelversion)) {
   exit 1;
 }
 if (!$module_dir) {


hooks/post-receive
--
Cluster Project


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]