aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Homebrew/formula.rb
diff options
context:
space:
mode:
authorJoshua Peek2010-09-24 11:55:21 -0500
committerAdam Vandenberg2010-10-26 09:39:17 -0700
commita98a22503321ea36088663089e8ba8cd124ef019 (patch)
tree66c1360aa0ae29cbc163dcc27756b892de9eb54d /Library/Homebrew/formula.rb
parentd89bcba4ef99dc1e8ecce8733350d06b664431bf (diff)
downloadhomebrew-a98a22503321ea36088663089e8ba8cd124ef019.tar.bz2
Prefer HEAD version if its installed
Signed-off-by: Adam Vandenberg <flangy@gmail.com>
Diffstat (limited to 'Library/Homebrew/formula.rb')
-rw-r--r--Library/Homebrew/formula.rb11
1 files changed, 10 insertions, 1 deletions
diff --git a/Library/Homebrew/formula.rb b/Library/Homebrew/formula.rb
index d6a536f5f..d9f110982 100644
--- a/Library/Homebrew/formula.rb
+++ b/Library/Homebrew/formula.rb
@@ -98,11 +98,20 @@ class Formula
# if the dir is there, but it's empty we consider it not installed
def installed?
- return prefix.children.length > 0
+ return installed_prefix.children.length > 0
rescue
return false
end
+ def installed_prefix
+ head_prefix = HOMEBREW_CELLAR+@name+'HEAD'
+ if @version == 'HEAD' || head_prefix.directory?
+ head_prefix
+ else
+ prefix
+ end
+ end
+
def path
self.class.path name
end