Unlink old keg when upgrading dependencies
Installing a formula via `brew install` may trigger upgrades of its dependencies if the dependencies are installed but outdated. However, we never unlinked the existing keg in FormulaInstaller#install_dependency which caused the link step to fail. Signed-off-by: Jack Nagel <jacknagel@gmail.com>
This commit is contained in:
parent
8d100a0508
commit
411d15d407
@ -156,6 +156,11 @@ class Formula
|
||||
ARGV.formulae.include? self
|
||||
end
|
||||
|
||||
def linked_keg
|
||||
keg = Pathname.new(HOMEBREW_REPOSITORY/"Library/LinkedKegs"/@name)
|
||||
if keg.exist? then Keg.new(keg.realpath) else nil end
|
||||
end
|
||||
|
||||
def installed_prefix
|
||||
head_prefix = HOMEBREW_CELLAR+@name+'HEAD'
|
||||
if @version == 'HEAD' || head_prefix.directory?
|
||||
|
@ -67,6 +67,7 @@ class FormulaInstaller
|
||||
fi.show_header = false
|
||||
oh1 "Installing #{f} dependency: #{dep}"
|
||||
fi.install
|
||||
dep.linked_keg.unlink if dep.linked_keg
|
||||
fi.caveats
|
||||
fi.finish
|
||||
end
|
||||
|
Loading…
x
Reference in New Issue
Block a user