ruby-changes:61424
From: Nobuyoshi <ko1@a...>
Date: Sat, 30 May 2020 01:16:17 +0900 (JST)
Subject: [ruby-changes:61424] 0d1f0cd9cc (master): runnable.rb: ignore broken symlink error on Windows [ci skip]
https://git.ruby-lang.org/ruby.git/commit/?id=0d1f0cd9cc From 0d1f0cd9ccb8c4d237f1eba92254a2ab306ae231 Mon Sep 17 00:00:00 2001 From: Nobuyoshi Nakada <nobu@r...> Date: Sat, 30 May 2020 01:15:23 +0900 Subject: runnable.rb: ignore broken symlink error on Windows [ci skip] diff --git a/tool/mkrunnable.rb b/tool/mkrunnable.rb index 01756a3..cb211fd 100755 --- a/tool/mkrunnable.rb +++ b/tool/mkrunnable.rb @@ -45,6 +45,10 @@ end https://github.com/ruby/ruby/blob/trunk/tool/mkrunnable.rb#L45 def ln_safe(src, dest) ln_sf(src, dest) +rescue Errno::ENOENT + # Windows disallows to create broken symboic links, probably because + # it is a kind of reparse points. + raise if File.exist?(src) end alias ln_dir_safe ln_safe @@ -64,8 +68,8 @@ def relative_path_from(path, base) https://github.com/ruby/ruby/blob/trunk/tool/mkrunnable.rb#L68 base = clean_path(base) path, base = [path, base].map{|s|s.split("/")} until path.empty? or base.empty? or path[0] != base[0] - path.shift - base.shift + path.shift + base.shift end path, base = [path, base].map{|s|s.join("/")} if /(\A|\/)\.\.\// =~ base -- cgit v0.10.2 -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/