diff --git a/Library/Homebrew/formula.rb b/Library/Homebrew/formula.rb index 9b3c0ac5f3..4256cfb776 100644 --- a/Library/Homebrew/formula.rb +++ b/Library/Homebrew/formula.rb @@ -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? diff --git a/Library/Homebrew/formula_installer.rb b/Library/Homebrew/formula_installer.rb index c2c04c8f3d..deee2b9563 100644 --- a/Library/Homebrew/formula_installer.rb +++ b/Library/Homebrew/formula_installer.rb @@ -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