[ruby-oci8-commit] [266] branches/ruby-oci8-1.0: * ext/oci8/oraconf.rb: prints more information on checking

nobody at rubyforge.org nobody at rubyforge.org
Sat Jul 5 10:31:25 EDT 2008


Revision: 266
Author:   kubo
Date:     2008-07-05 10:31:24 -0400 (Sat, 05 Jul 2008)

Log Message:
-----------
* ext/oci8/oraconf.rb: prints more information on checking
   LD_LIBRARY_PATH.

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

Modified: branches/ruby-oci8-1.0/ChangeLog
===================================================================
--- branches/ruby-oci8-1.0/ChangeLog	2008-06-26 14:30:44 UTC (rev 265)
+++ branches/ruby-oci8-1.0/ChangeLog	2008-07-05 14:31:24 UTC (rev 266)
@@ -1,3 +1,7 @@
+2008-07-05  KUBO Takehiro  <kubo at jiubao.org>
+	* ext/oci8/oraconf.rb: prints more information on checking
+	   LD_LIBRARY_PATH.
+
 2008-06-26  KUBO Takehiro  <kubo at jiubao.org>
 	* NEWS: add changes between 1.0.1 and 1.0.2.
 	* VERSION: change version to 1.0.2.

Modified: branches/ruby-oci8-1.0/ext/oci8/oraconf.rb
===================================================================
--- branches/ruby-oci8-1.0/ext/oci8/oraconf.rb	2008-06-26 14:30:44 UTC (rev 265)
+++ branches/ruby-oci8-1.0/ext/oci8/oraconf.rb	2008-07-05 14:31:24 UTC (rev 266)
@@ -270,7 +270,7 @@
   private
 
   def self.check_ic_dir
-    print "checking for load library path... "
+    puts "checking for load library path... "
     STDOUT.flush
 
     # get library load path names
@@ -340,24 +340,34 @@
     glob_name = "#{oci_basename}.#{so_ext}#{oci_glob_postfix}"
     ld_path = nil
     file = nil
-    @@ld_envs.collect do |env|
-      puts "(#{env})... "
-      ENV[env] && ENV[env].split(File::PATH_SEPARATOR)
-    end.flatten.each do |path|
-      next if path.nil? or path == ''
-      path.gsub!(/\\/, '/') if /mswin32|cygwin|mingw32|bccwin32/ =~ RUBY_PLATFORM
-      files = Dir.glob(File.join(path, glob_name))
-      next if files.empty?
-      STDOUT.flush
-      next if (check_proc && !check_proc.call(files[0]))
-      file = files[0]
-      ld_path = path
+    @@ld_envs.each do |env|
+      if ENV[env].nil?
+        puts "  #{env} is not set."
+        next
+      end
+      puts "  #{env}... "
+      ENV[env].split(File::PATH_SEPARATOR).each do |path|
+        next if path.nil? or path == ''
+        print "    checking #{path}... "
+        path.gsub!(/\\/, '/') if /mswin32|cygwin|mingw32|bccwin32/ =~ RUBY_PLATFORM
+        files = Dir.glob(File.join(path, glob_name))
+        if files.empty?
+          puts "no"
+          next
+        end
+        STDOUT.flush
+        next if (check_proc && !check_proc.call(files[0]))
+        file = files[0]
+        ld_path = path
+        puts "yes"
+        break
+      end
       break
     end
 
     if ld_path.nil? and RUBY_PLATFORM =~ /linux/
       open("|/sbin/ldconfig -p") do |f|
-        print "(ld.so.conf)... "
+        print "  checking ld.so.conf... "
         STDOUT.flush
         while line = f.gets
           if line =~ /libclntsh\.so\..* => (\/.*)\/libclntsh\.so\.(.*)/
@@ -365,22 +375,22 @@
             path = $1
             next if (check_proc && !check_proc.call(file))
             ld_path = path
+            puts "yes"
             break
           end
         end
+        puts "no"
       end
     end
 
     if ld_path
       ocidata_basename.each do |basename|
         if File.exist?(File.join(ld_path, "#{basename}.#{so_ext}"))
-          puts "  found: #{file} looks like an instant client."
+          puts "  #{file} looks like an instant client."
           return ld_path
         end
       end
-      puts "  found: #{file} looks like a full client."
-    else
-      puts "  not found"
+      puts "  #{file} looks like a full client."
     end
     nil
   end




More information about the ruby-oci8-commit mailing list