[svn:dbd-oracle] r15356 - dbd-oracle/trunk

[email protected] Mon, 6 Aug 2012 03:50:59 -0700 (PDT)
Newsgroups perl.dbd.oracle.changes
Message-ID <[email protected]>
Author: mjevans
Date: Mon Aug  6 03:50:58 2012
New Revision: 15356

Modified:
   dbd-oracle/trunk/Changes
   dbd-oracle/trunk/Makefile.PL

Log:
Fix issue finding client on machine with client and server
  and diff architectures


Modified: dbd-oracle/trunk/Changes
==============================================================================
--- dbd-oracle/trunk/Changes	(original)
+++ dbd-oracle/trunk/Changes	Mon Aug  6 03:50:58 2012
@@ -6,6 +6,9 @@
 
   - fix serious memory corruption in TAF support (Martin J. Evans)
 
+  - fix finding client in situation where client and server both
+    installed but different architectures (patch by H.Merijn Brand)
+
   [MISCELLANEOUS]
 
   - hide dr, db and st packages from PAUSE

Modified: dbd-oracle/trunk/Makefile.PL
==============================================================================
--- dbd-oracle/trunk/Makefile.PL	(original)
+++ dbd-oracle/trunk/Makefile.PL	Mon Aug  6 03:50:58 2012
@@ -1525,7 +1525,7 @@
     # compensate for case where final .0 isn't in the install directory name
     (my $client_version_trim = $client_version_full) =~ s/\.0$//;
 
-    my @try = (	# search the ORACLE_HOME we're using first
+    my @try = grep { -d $_ } (	# search the ORACLE_HOME we're using first
        # --- Traditional full-install locations
        "$OH/rdbms/public", # prefer public over others
        "$OH/rdbms",
@@ -1533,19 +1533,23 @@
        # --- Oracle SDK Instant Client locations
        "$OH/sdk/include",
        # --- Oracle RPM Instant Client locations
-       "/usr/include/oracle/$client_version_full/client", # Instant Client for RedHat FC4
-       "/usr/include/oracle/$client_version_trim/client", # Instant Client for RedHat FC4
-       "/include/oracle/$client_version_full/client", # Instant Client for RedHat FC3
-       "/include/oracle/$client_version_trim/client", # Instant Client for RedHat FC3
-       "/usr/include/oracle/$client_version/client", # Instant Client 11.1 and up
-       "/usr/include/oracle/$client_version/client64", # Instant Client 11.1 and up
-       "/usr/include/oracle/$client_version_trim/client64", # Instant Client 64
-       "/usr/include/oracle/$client_version_full/client64", # Instant Client 64
-
+       map { ( $_, $_."64"   ) }
+       map { ( $_, "/usr$_" ) }
+       map { "/include/oracle/$_/client" }
+       	$client_version,
+       	$client_version_trim,
+       	$client_version_full,
+
+       #"/include/oracle/$client_version_full/client",       # Instant Client for RedHat FC3
+       #"/include/oracle/$client_version_trim/client",       # Instant Client for RedHat FC3
+       #"/usr/include/oracle/$client_version/client64",      # Instant Client 11.1 and up
+       #"/usr/include/oracle/$client_version/client",        # Instant Client 11.1 and up
+       #"/usr/include/oracle/$client_version_full/client64", # Instant Client 64
+       #"/usr/include/oracle/$client_version_full/client",   # Instant Client for RedHat FC4
+       #"/usr/include/oracle/$client_version_trim/client64", # Instant Client 64
+       #"/usr/include/oracle/$client_version_trim/client",   # Instant Client for RedHat FC4
     );
 
-
-
    # Add /usr/include/oracle based on the oracle home location if oracle home is under
    # /usr/lib/oracle ( Linux RPM install ).  The 11g instant client reports
    # client_version as 11.1.0.6 from sqlplus, but installs under 11.1.0.1.
@@ -1809,10 +1813,10 @@
 	my ($ldrp) = $self->{LD_RUN_PATH};
 	# remove redundant /lib or /usr/lib as it can cause problems
 	$ldrp =~ s!:(/usr)?/lib$!! if $ldrp;
-        # if it's empty then set it manually
-        #Lincoln: if pick the right library path
-        my $libdir = main::ora_libdir();
-        $ldrp ||= "$OH/$libdir:$OH/rdbms/$libdir";
+    # if it's empty then set it manually
+    #Lincoln: if pick the right library path
+    my $libdir = main::ora_libdir();
+    $ldrp ||= "$OH/$libdir:$OH/rdbms/$libdir";
 	$self->{LD_RUN_PATH} = $ldrp;
 
 	local($_) = $self->SUPER::const_loadlibs(@_);