ruby-1.9-clean-chdir.patch

Pierre-Yves Ritschard, 01/29/2011 01:44 AM

Download (1.1 KB)

View differences:

installer.rb (working copy)
481 481
  def build_extensions
482 482
    return if @spec.extensions.empty?
483 483
    say "Building native extensions.  This could take a while..."
484
    start_dir = Dir.pwd
485 484
    dest_path = File.join @gem_dir, @spec.require_paths.first
486 485
    ran_rake = false # only run rake once
487 486

  
......
503 502
                end
504 503

  
505 504
      begin
506
        Dir.chdir File.join(@gem_dir, File.dirname(extension))
507
        results = builder.build(extension, @gem_dir, dest_path, results)
505
        Dir.chdir File.join(@gem_dir, File.dirname(extension)) do
506
          results = builder.build(extension, @gem_dir, dest_path, results)
508 507

  
509
        say results.join("\n") if Gem.configuration.really_verbose
508
          say results.join("\n") if Gem.configuration.really_verbose
509
        end
510 510

  
511 511
      rescue
512 512
        results = results.join "\n"
......
523 523
        EOF
524 524

  
525 525
        raise ExtensionBuildError, message
526
      ensure
527
        Dir.chdir start_dir
528 526
      end
529 527
    end
530 528
  end