aboutsummaryrefslogtreecommitdiffstats
path: root/tool
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-05-22 04:10:51 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-05-22 04:10:51 +0000
commit4396022e080b157b4ad6c8e3be14d88656e5e856 (patch)
tree900cb3419f0ac3ccf188fe2549c07a39dc374275 /tool
parent92ed99d81a5bf1dca98e9cdbf66038b16e7b854b (diff)
downloadruby-4396022e080b157b4ad6c8e3be14d88656e5e856.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.rb18
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)