diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2017-05-22 04:10:51 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2017-05-22 04:10:51 +0000 |
commit | c45a52af36dbe399ec87b97db13812e20fa500d1 (patch) | |
tree | 900cb3419f0ac3ccf188fe2549c07a39dc374275 /tool | |
parent | 72fb1e1690d71f9ec9e33bc3bc282689c7afe2b4 (diff) | |
download | ruby-c45a52af36dbe399ec87b97db13812e20fa500d1.tar.gz |
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
Diffstat (limited to 'tool')
-rw-r--r-- | tool/downloader.rb | 18 |
1 files changed, 10 insertions, 8 deletions
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) |