diff options
| author | Xu Cheng | 2016-07-17 01:59:54 +0800 |
|---|---|---|
| committer | Xu Cheng | 2016-07-17 02:16:18 +0800 |
| commit | 1eaa95b805dc8cd8e25630bd2c47d1b2c484a47a (patch) | |
| tree | a80e3337244baf5f7b029a5ca61b057fc2b79745 | |
| parent | 177d988917a7b793914bb082a908aa74cde0c999 (diff) | |
| download | brew-1eaa95b805dc8cd8e25630bd2c47d1b2c484a47a.tar.bz2 | |
Keg#link: run optlink first
This prevents a link conflict during `brew upgrade` causing opt link
stuck to old version. At this point, users will have to run `brew switch`
to fix it.
Closes #533.
Signed-off-by: Xu Cheng <xucheng@me.com>
| -rw-r--r-- | Library/Homebrew/keg.rb | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/Library/Homebrew/keg.rb b/Library/Homebrew/keg.rb index 9adf657fe..67b66a2dc 100644 --- a/Library/Homebrew/keg.rb +++ b/Library/Homebrew/keg.rb @@ -304,6 +304,8 @@ class Keg ObserverPathnameExtension.reset_counts! + optlink(mode) unless mode.dry_run + # yeah indeed, you have to force anything you need in the main tree into # these dirs REMEMBER that *NOT* everything needs to be in the main tree link_dir("etc", mode) { :mkpath } @@ -366,10 +368,7 @@ class Keg end end - unless mode.dry_run - make_relative_symlink(linked_keg_record, path, mode) - optlink(mode) - end + make_relative_symlink(linked_keg_record, path, mode) unless mode.dry_run rescue LinkError unlink raise |
