subversion-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pbu...@apache.org
Subject svn commit: r1482524 - /subversion/trunk/subversion/bindings/swig/ruby/test/windows_util.rb
Date Tue, 14 May 2013 19:07:34 GMT
Author: pburba
Date: Tue May 14 19:07:34 2013
New Revision: 1482524

URL: http://svn.apache.org/r1482524
Log:
* subversion/bindings/swig/ruby/test/windows_util.rb
  (SvnTestUtil.Windows.Svnserve.setup_svnserve): Allow Ruby binding tests to
   run with BDB versions other than 4.4.  Also remove some commented debug
   cruft from r1482479.




Modified:
    subversion/trunk/subversion/bindings/swig/ruby/test/windows_util.rb

Modified: subversion/trunk/subversion/bindings/swig/ruby/test/windows_util.rb
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/bindings/swig/ruby/test/windows_util.rb?rev=1482524&r1=1482523&r2=1482524&view=diff
==============================================================================
--- subversion/trunk/subversion/bindings/swig/ruby/test/windows_util.rb (original)
+++ subversion/trunk/subversion/bindings/swig/ruby/test/windows_util.rb Tue May 14 19:07:34
2013
@@ -93,38 +93,44 @@ module SvnTestUtil
           %r'^\s*#define\s+APR_MAJOR_VERSION\s+(\d+)' =~ apr_version_include.read
           apr_major_version = $1 == '0' ? '' : "-#{$1}"
 
+          cwd = Dir.getwd
           targets = %W(svnserve.exe libsvn_subr-1.dll libsvn_repos-1.dll
                        libsvn_fs-1.dll libsvn_delta-1.dll
                        libaprutil#{apr_major_version}.dll
                        libapr#{apr_major_version}.dll
                        libapriconv#{apr_major_version}.dll
-                       libdb44.dll libdb44d.dll)
+                       libdb??.dll libdb??d.dll)
           ENV["PATH"].split(";").each do |path|
+
+            # Change the cwd to path, but ignore non-existent paths.
+            begin
+              Dir.chdir(path)
+            rescue Errno::ENOENT
+            end
+
             found_targets = []
             targets.each do |target|
-              target_path = "#{path}\\#{target}"
-              if File.exists?(target_path)
-                found_targets << target
-                retried = 0
-                begin
-                  FileUtils.cp(target_path, svnserve_dir)
-                rescue Errno::EACCES
-                  # On Windows the tests frequently fail spuriously with a
-                  # 'Errno::EACCES: Permission denied - svnserve.exe' error.
-                  # Sleeping for a few seconds avoids this.
-                  #puts "\nFailed to copy"
-                  #puts $!
-                  #puts "'#{target_path}' to"
-                  #puts "'#{svnserve_dir}'"
-                  #puts "Sleeping for 1 sec, then retrying."
-                  if retried > 5
-                    # Give up!
-                    raise
-                  else
-                    # Wait a sec...
-                    sleep(1)
-                    retried += 1
-                    retry
+              matching_paths = Dir.glob(target)
+              matching_paths.each do |target_path|
+                target_path = File.join(path.tr('\\', '/'), target_path)
+                if File.exists?(target_path)
+                  found_targets << target
+                  retried = 0
+                  begin
+                    FileUtils.cp(target_path, svnserve_dir)
+                  rescue Errno::EACCES
+                    # On Windows the tests frequently fail spuriously with a
+                    # 'Errno::EACCES: Permission denied - svnserve.exe' error.
+                    # Sleeping for a few seconds avoids this.
+                    if retried > 5
+                      # Give up!
+                      raise
+                    else
+                      # Wait a sec...
+                      sleep(1)
+                      retried += 1
+                      retry
+                    end
                   end
                 end
               end
@@ -132,6 +138,7 @@ module SvnTestUtil
             targets -= found_targets
             break if targets.empty?
           end
+          Dir.chdir(cwd)
           # Remove optional targets instead of raising below.  If they are really
           # needed, svnserve won't start anyway.
           targets -= %W[libapriconv#{apr_major_version}.dll]



Mime
View raw message