diff options
| author | Jack Nagel | 2014-03-27 09:35:10 -0500 |
|---|---|---|
| committer | Jack Nagel | 2014-03-27 09:35:10 -0500 |
| commit | f357cc6ebb0c9fc3210d5edc3eeb5724b717e149 (patch) | |
| tree | 96e3ce07e4dbc5715e9daa0bbc2b4512f7cbe5a2 /Library/Homebrew/extend/pathname.rb | |
| parent | c1c47b56c826bda0d50f870ac67c2a5af9df5fd3 (diff) | |
| download | homebrew-f357cc6ebb0c9fc3210d5edc3eeb5724b717e149.tar.bz2 | |
Don't let broken symlinks halt linking
Diffstat (limited to 'Library/Homebrew/extend/pathname.rb')
| -rw-r--r-- | Library/Homebrew/extend/pathname.rb | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/Library/Homebrew/extend/pathname.rb b/Library/Homebrew/extend/pathname.rb index 1ec35b9cd..dd95cc789 100644 --- a/Library/Homebrew/extend/pathname.rb +++ b/Library/Homebrew/extend/pathname.rb @@ -298,7 +298,7 @@ class Pathname # NOTE only system ln -s will create RELATIVE symlinks quiet_system 'ln', '-s', src.relative_path_from(self.dirname), self.basename if not $?.success? - if symlink? && exist? || symlink? + if symlink? && exist? raise <<-EOS.undent Could not symlink file: #{src.expand_path} Target #{self} already exists as a symlink to #{readlink}. @@ -320,6 +320,9 @@ class Pathname To list all files that would be deleted: brew link --overwrite --dry-run formula_name EOS + elsif symlink? + unlink + make_relative_symlink(src) elsif !dirname.writable_real? raise <<-EOS.undent Could not symlink file: #{src.expand_path} |
