mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
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
This commit is contained in:
parent
72fb1e1690
commit
c45a52af36
1 changed files with 10 additions and 8 deletions
|
@ -225,6 +225,7 @@ class Downloader
|
||||||
def self.link_cache(cache, file, name, verbose = false)
|
def self.link_cache(cache, file, name, verbose = false)
|
||||||
return false unless cache and cache.exist?
|
return false unless cache and cache.exist?
|
||||||
return true if cache.eql?(file)
|
return true if cache.eql?(file)
|
||||||
|
if /cygwin/ !~ RUBY_PLATFORM or /winsymlink:nativestrict/ =~ ENV['CYGWIN']
|
||||||
begin
|
begin
|
||||||
file.make_symlink(cache.relative_path_from(file.parent))
|
file.make_symlink(cache.relative_path_from(file.parent))
|
||||||
rescue SystemCallError
|
rescue SystemCallError
|
||||||
|
@ -235,6 +236,7 @@ class Downloader
|
||||||
end
|
end
|
||||||
return true
|
return true
|
||||||
end
|
end
|
||||||
|
end
|
||||||
begin
|
begin
|
||||||
file.make_link(cache)
|
file.make_link(cache)
|
||||||
rescue SystemCallError
|
rescue SystemCallError
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue