From c45a52af36dbe399ec87b97db13812e20fa500d1 Mon Sep 17 00:00:00 2001 From: nobu Date: Mon, 22 May 2017 04:10:51 +0000 Subject: downloader.rb: true symlink on cygwin * tool/downloader.rb (Downloader.link_cache): on Cygwin, make true symlink only, which is provided by the OS. as mingw/mswin ruby can't follow cygwin's pseudo symlink, it will fail on the same source tree. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58843 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- tool/downloader.rb | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) (limited to 'tool') diff --git a/tool/downloader.rb b/tool/downloader.rb index a8c47f02c7..0498e3f95c 100644 --- a/tool/downloader.rb +++ b/tool/downloader.rb @@ -225,15 +225,17 @@ class Downloader def self.link_cache(cache, file, name, verbose = false) return false unless cache and cache.exist? return true if cache.eql?(file) - begin - file.make_symlink(cache.relative_path_from(file.parent)) - rescue SystemCallError - else - if verbose - $stdout.puts "made symlink #{name} to #{cache}" - $stdout.flush + if /cygwin/ !~ RUBY_PLATFORM or /winsymlink:nativestrict/ =~ ENV['CYGWIN'] + begin + file.make_symlink(cache.relative_path_from(file.parent)) + rescue SystemCallError + else + if verbose + $stdout.puts "made symlink #{name} to #{cache}" + $stdout.flush + end + return true end - return true end begin file.make_link(cache) -- cgit v1.2.1