Move this code into FormulaInstaller

The correct location for it IMO. Also added warning for the user.
This commit is contained in:
Max Howell 2012-02-21 11:40:06 +00:00
parent 61a8bd9ca0
commit 2431c00c92
2 changed files with 6 additions and 1 deletions

View File

@ -105,7 +105,6 @@ module Homebrew extend self
fi = FormulaInstaller.new(f)
fi.install
fi.caveats
f.linked_keg.unlink if f.linked_keg.directory? and f.linked_keg.realpath == f.prefix
fi.finish
rescue FormulaAlreadyInstalledError => e
opoo e.message

View File

@ -158,6 +158,12 @@ class FormulaInstaller
end
def link
if f.linked_keg.directory? and f.linked_keg.realpath == f.prefix
opoo "This keg was marked linked already, continuing anyway"
# otherwise Keg.link will bail
f.linked_keg.unlink
end
Keg.new(f.prefix).link
rescue Exception => e
onoe "The linking step did not complete successfully"