[ruby-oci8-commit] [435] trunk/ruby-oci8/ext/oci8: * ext/oci8/oraconf.rb: Fix for Oracle 11g solaris-sparc32 instant client.

nobody at rubyforge.org nobody at rubyforge.org
Sat Jul 16 09:27:27 EDT 2011


Revision: 435
Author:   kubo
Date:     2011-07-16 09:27:26 -0400 (Sat, 16 Jul 2011)

Log Message:
-----------
* ext/oci8/oraconf.rb: Fix for Oracle 11g solaris-sparc32 instant client.
    The machine type of Oracle 10g solaris-sparc32 instant client was
    sparc but that of oracle 11g is sparc32plus.
    (Reported by Sanjiv Patel.)

Modified Paths:
--------------
    branches/ruby-oci8-2.0/ChangeLog
    branches/ruby-oci8-2.0/ext/oci8/oraconf.rb
    trunk/ruby-oci8/ChangeLog
    trunk/ruby-oci8/ext/oci8/oraconf.rb

Modified: branches/ruby-oci8-2.0/ChangeLog
===================================================================
--- branches/ruby-oci8-2.0/ChangeLog	2011-06-15 12:56:35 UTC (rev 434)
+++ branches/ruby-oci8-2.0/ChangeLog	2011-07-16 13:27:26 UTC (rev 435)
@@ -1,3 +1,9 @@
+2011-07-16  KUBO Takehiro  <kubo at jiubao.org>
+	* ext/oci8/oraconf.rb: Fix for Oracle 11g solaris-sparc32 instant client.
+	    The machine type of Oracle 10g solaris-sparc32 instant client was
+	    sparc but that of oracle 11g is sparc32plus.
+	    (Reported by Sanjiv Patel.)
+
 2011-06-14  KUBO Takehiro  <kubo at jiubao.org>
 	* NEWS: add changes between 2.0.5 and 2.0.6.
 	* VERSION: change the version to 2.0.6.

Modified: branches/ruby-oci8-2.0/ext/oci8/oraconf.rb
===================================================================
--- branches/ruby-oci8-2.0/ext/oci8/oraconf.rb	2011-06-15 12:56:35 UTC (rev 434)
+++ branches/ruby-oci8-2.0/ext/oci8/oraconf.rb	2011-07-16 13:27:26 UTC (rev 435)
@@ -148,7 +148,7 @@
         read_mach_o_unversal(f)
       else
         # AIX and Tru64
-        raise format("unknown file header: %02x %02x", file_header[0], file_header[1])
+        raise format("unknown file header: %02x %02x", file_header[0].to_i, file_header[1].to_i)
       end
     ensure
       f.close
@@ -193,6 +193,8 @@
       @cpu = :i386
     when 15
       @cpu = :parisc
+    when 18
+      @cpu = :sparc32plus
     when 20
       @cpu = :ppc
     when 21
@@ -378,10 +380,10 @@
 
   private
 
-  def self.make_proc_to_check_cpu(expect)
+  def self.make_proc_to_check_cpu(*expect)
     Proc.new do |file|
       so = MiniSOReader.new(file)
-      if so.cpu == expect
+      if expect.include? so.cpu
         true
       else
         puts "  skip: #{file} is for #{so.cpu} cpu."
@@ -432,7 +434,7 @@
       if is_32bit
         @@ld_envs = %w[LD_LIBRARY_PATH_32 LD_LIBRARY_PATH]
         if is_big_endian
-          check_proc = make_proc_to_check_cpu(:sparc)
+          check_proc = make_proc_to_check_cpu(:sparc, :sparc32plus)
         else
           check_proc = make_proc_to_check_cpu(:i386)
         end

Modified: trunk/ruby-oci8/ChangeLog
===================================================================
--- trunk/ruby-oci8/ChangeLog	2011-06-15 12:56:35 UTC (rev 434)
+++ trunk/ruby-oci8/ChangeLog	2011-07-16 13:27:26 UTC (rev 435)
@@ -1,3 +1,9 @@
+2011-07-16  KUBO Takehiro  <kubo at jiubao.org>
+	* ext/oci8/oraconf.rb: Fix for Oracle 11g solaris-sparc32 instant client.
+	    The machine type of Oracle 10g solaris-sparc32 instant client was
+	    sparc but that of oracle 11g is sparc32plus.
+	    (Reported by Sanjiv Patel.)
+
 2011-06-15  KUBO Takehiro  <kubo at jiubao.org>
 	* ext/oci8/apiwrap.yml, ext/oci8/bind.c, ext/oci8/oci8.c, ext/oci8/oci8lib.c,
 	  lib/oci8/bindtype.rb: drop Oracle 8i support.

Modified: trunk/ruby-oci8/ext/oci8/oraconf.rb
===================================================================
--- trunk/ruby-oci8/ext/oci8/oraconf.rb	2011-06-15 12:56:35 UTC (rev 434)
+++ trunk/ruby-oci8/ext/oci8/oraconf.rb	2011-07-16 13:27:26 UTC (rev 435)
@@ -148,7 +148,7 @@
         read_mach_o_unversal(f)
       else
         # AIX and Tru64
-        raise format("unknown file header: %02x %02x", file_header[0], file_header[1])
+        raise format("unknown file header: %02x %02x", file_header[0].to_i, file_header[1].to_i)
       end
     ensure
       f.close
@@ -193,6 +193,8 @@
       @cpu = :i386
     when 15
       @cpu = :parisc
+    when 18
+      @cpu = :sparc32plus
     when 20
       @cpu = :ppc
     when 21
@@ -378,10 +380,10 @@
 
   private
 
-  def self.make_proc_to_check_cpu(expect)
+  def self.make_proc_to_check_cpu(*expect)
     Proc.new do |file|
       so = MiniSOReader.new(file)
-      if so.cpu == expect
+      if expect.include? so.cpu
         true
       else
         puts "  skip: #{file} is for #{so.cpu} cpu."
@@ -432,7 +434,7 @@
       if is_32bit
         @@ld_envs = %w[LD_LIBRARY_PATH_32 LD_LIBRARY_PATH]
         if is_big_endian
-          check_proc = make_proc_to_check_cpu(:sparc)
+          check_proc = make_proc_to_check_cpu(:sparc, :sparc32plus)
         else
           check_proc = make_proc_to_check_cpu(:i386)
         end




More information about the ruby-oci8-commit mailing list