aboutsummaryrefslogtreecommitdiffstats
path: root/Library
diff options
context:
space:
mode:
authorMax Howell2012-02-21 11:40:06 +0000
committerMax Howell2012-02-21 11:40:06 +0000
commit2431c00c928a5ef5bc5dad51a219426b12dad011 (patch)
tree3d481b716903a6a83dfd0c369a95268aebe6f625 /Library
parent61a8bd9ca0d30c571212f534e4262715fba72e49 (diff)
downloadbrew-2431c00c928a5ef5bc5dad51a219426b12dad011.tar.bz2
Move this code into FormulaInstaller
The correct location for it IMO. Also added warning for the user.
Diffstat (limited to 'Library')
-rw-r--r--Library/Homebrew/cmd/install.rb1
-rw-r--r--Library/Homebrew/formula_installer.rb6
2 files changed, 6 insertions, 1 deletions
diff --git a/Library/Homebrew/cmd/install.rb b/Library/Homebrew/cmd/install.rb
index 6b2f5ea0c..8fad2b48b 100644
--- a/Library/Homebrew/cmd/install.rb
+++ b/Library/Homebrew/cmd/install.rb
@@ -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
diff --git a/Library/Homebrew/formula_installer.rb b/Library/Homebrew/formula_installer.rb
index 39c956545..72cfa69e5 100644
--- a/Library/Homebrew/formula_installer.rb
+++ b/Library/Homebrew/formula_installer.rb
@@ -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"