diff options
| author | Jack Nagel | 2014-07-10 15:39:55 -0500 |
|---|---|---|
| committer | Jack Nagel | 2014-07-10 15:39:55 -0500 |
| commit | 284389a6bd4bf88269b4db580015e8590dd76a37 (patch) | |
| tree | 0d32b56bf57b537065a99119f9754ee3fc613f9a /Library | |
| parent | 126d2133ab824072f526bc88830a5b9948247bfb (diff) | |
| download | brew-284389a6bd4bf88269b4db580015e8590dd76a37.tar.bz2 | |
Make comment in Pathname#install more accurate
Diffstat (limited to 'Library')
| -rw-r--r-- | Library/Homebrew/extend/pathname.rb | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/Library/Homebrew/extend/pathname.rb b/Library/Homebrew/extend/pathname.rb index d38b6b2cd..fdf5395c9 100644 --- a/Library/Homebrew/extend/pathname.rb +++ b/Library/Homebrew/extend/pathname.rb @@ -45,22 +45,19 @@ class Pathname src = src.to_s dst = dst.to_s - # if it's a symlink, don't resolve it to a file because if we are moving - # files one by one, it's likely we will break the symlink by moving what - # it points to before we move it - # and also broken symlinks are not the end of the world raise "#{src} does not exist" unless File.symlink? src or File.exist? src dst = yield(src, dst) if block_given? mkpath + + # Use FileUtils.mv over File.rename to handle filesystem boundaries. If src + # is a symlink, and its target is moved first, FileUtils.mv will fail: + # https://bugs.ruby-lang.org/issues/7707 + # In that case, use the system "mv" command. if File.symlink? src - # we use the BSD mv command because FileUtils copies the target and - # not the link! I'm beginning to wish I'd used Python quite honestly! raise unless Kernel.system 'mv', src, dst else - # we mv when possible as it is faster and you should only be using - # this function when installing from the temporary build directory FileUtils.mv src, dst end end |
