mirror of
https://github.com/Homebrew/brew.git
synced 2025-07-14 16:09:03 +08:00
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>
This commit is contained in:
parent
177d988917
commit
1eaa95b805
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user