cluster-devel.redhat.com archive mirror
 help / color / mirror / Atom feed
* [Cluster-devel] Fix for configure and kernel trees
@ 2007-09-27 22:30 Joel Becker
  2007-09-27 22:33 ` [Cluster-devel] " Joel Becker
  2007-09-28  3:18 ` Fabio Massimo Di Nitto
  0 siblings, 2 replies; 3+ messages in thread
From: Joel Becker @ 2007-09-27 22:30 UTC (permalink / raw)
  To: cluster-devel.redhat.com


configure: Backticks don't work in strings.  Use POSIX::uname().

The strings that use backticks to get `uname -r` don't work as expected.
Let's use POSIX::uname() directly and let perl do the work.


Index: configure
===================================================================
RCS file: /cvs/cluster/cluster/configure,v
retrieving revision 1.34
diff -u -u -r1.34 configure
--- configure	24 Sep 2007 14:43:13 -0000	1.34
+++ configure	27 Sep 2007 22:28:30 -0000
@@ -14,6 +14,7 @@
 ###############################################################################
 
 use Getopt::Long;
+use POSIX qw(uname);
 
 print "\nConfiguring Makefiles for your system...\n";
 
@@ -228,22 +229,25 @@
 if (!$prefix) {
   $prefix="/usr";
 }
+
+my @un = POSIX::uname();
 if (!$kernel_build) {
-  if (-d "/lib/modules/`uname -r`/build") {
-    $kernel_build="/lib/modules/`uname -r`/build";
+  printf("dir: \"%s\" \"%d\"\n", "/lib/modules/$un[2]/build", -d "/lib/modules/$un[2]/build");
+  if (-d "/lib/modules/$un[2]/build") {
+    $kernel_build="/lib/modules/$un[2]/build";
   } else {
     $kernel_build="/usr/src/linux";
   }
 }
 if (!$kernel_src) {
-  if (-d "/lib/modules/`uname -r`/source") {
-    $kernel_src="/lib/modules/`uname -r`/source";
+  if (-d "/lib/modules/$un[2]/source") {
+    $kernel_src="/lib/modules/$un[2]/source";
   } else {
     $kernel_src=$kernel_build;
   }
 }
 if (!$module_dir) {
-  $module_dir="/lib/modules/`uname -r`/kernel";
+  $module_dir="/lib/modules/$un[2]/kernel";
 }
 if (!$gfskincdir) {
   $gfskincdir="${pwd}/gfs-kernel/src/gfs";

-- 

Viro's Razor:
	Any race condition, no matter how unlikely, will occur just
	often enough to bite you.

Joel Becker
Principal Software Developer
Oracle
E-mail: joel.becker at oracle.com
Phone: (650) 506-8127



^ permalink raw reply	[flat|nested] 3+ messages in thread

* [Cluster-devel] Re: Fix for configure and kernel trees
  2007-09-27 22:30 [Cluster-devel] Fix for configure and kernel trees Joel Becker
@ 2007-09-27 22:33 ` Joel Becker
  2007-09-28  3:18 ` Fabio Massimo Di Nitto
  1 sibling, 0 replies; 3+ messages in thread
From: Joel Becker @ 2007-09-27 22:33 UTC (permalink / raw)
  To: cluster-devel.redhat.com

On Thu, Sep 27, 2007 at 03:30:21PM -0700, Joel Becker wrote:
> configure: Backticks don't work in strings.  Use POSIX::uname().
> 
> The strings that use backticks to get `uname -r` don't work as expected.
> Let's use POSIX::uname() directly and let perl do the work.

[Resend, the first patch had a debug printf left in it]

Index: configure
===================================================================
RCS file: /cvs/cluster/cluster/configure,v
retrieving revision 1.34
diff -u -u -r1.34 configure
--- configure	24 Sep 2007 14:43:13 -0000	1.34
+++ configure	27 Sep 2007 22:32:16 -0000
@@ -14,6 +14,7 @@
 ###############################################################################
 
 use Getopt::Long;
+use POSIX qw(uname);
 
 print "\nConfiguring Makefiles for your system...\n";
 
@@ -228,22 +229,24 @@
 if (!$prefix) {
   $prefix="/usr";
 }
+
+my @un = POSIX::uname();
 if (!$kernel_build) {
-  if (-d "/lib/modules/`uname -r`/build") {
-    $kernel_build="/lib/modules/`uname -r`/build";
+  if (-d "/lib/modules/$un[2]/build") {
+    $kernel_build="/lib/modules/$un[2]/build";
   } else {
     $kernel_build="/usr/src/linux";
   }
 }
 if (!$kernel_src) {
-  if (-d "/lib/modules/`uname -r`/source") {
-    $kernel_src="/lib/modules/`uname -r`/source";
+  if (-d "/lib/modules/$un[2]/source") {
+    $kernel_src="/lib/modules/$un[2]/source";
   } else {
     $kernel_src=$kernel_build;
   }
 }
 if (!$module_dir) {
-  $module_dir="/lib/modules/`uname -r`/kernel";
+  $module_dir="/lib/modules/$un[2]/kernel";
 }
 if (!$gfskincdir) {
   $gfskincdir="${pwd}/gfs-kernel/src/gfs";
-- 

Life's Little Instruction Book #267

	"Lie on your back and look at the stars."

Joel Becker
Principal Software Developer
Oracle
E-mail: joel.becker at oracle.com
Phone: (650) 506-8127



^ permalink raw reply	[flat|nested] 3+ messages in thread

* [Cluster-devel] Re: Fix for configure and kernel trees
  2007-09-27 22:30 [Cluster-devel] Fix for configure and kernel trees Joel Becker
  2007-09-27 22:33 ` [Cluster-devel] " Joel Becker
@ 2007-09-28  3:18 ` Fabio Massimo Di Nitto
  1 sibling, 0 replies; 3+ messages in thread
From: Fabio Massimo Di Nitto @ 2007-09-28  3:18 UTC (permalink / raw)
  To: cluster-devel.redhat.com

Joel Becker wrote:
> configure: Backticks don't work in strings.  Use POSIX::uname().
> 
> The strings that use backticks to get `uname -r` don't work as expected.
> Let's use POSIX::uname() directly and let perl do the work.

Hi Joel,

could you be so kind to show me what is the behavior you expect and the one you
are seeing?

The backticks seems to work fine here. and I wonder if it might an environment
difference of some kind. I basically only want to be able to reproduce it.

Cheers
Fabio

-- 
I'm going to make him an offer he can't refuse.



^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2007-09-28  3:18 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-09-27 22:30 [Cluster-devel] Fix for configure and kernel trees Joel Becker
2007-09-27 22:33 ` [Cluster-devel] " Joel Becker
2007-09-28  3:18 ` Fabio Massimo Di Nitto

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).