formula: don't return outdated head in installed_prefix

This commit is contained in:
Vlad Shablinsky 2016-07-22 12:40:16 +03:00 committed by Xu Cheng
parent 1b88c2912b
commit a59bdc4a2a
No known key found for this signature in database
GPG Key ID: C2A3860FA0B459CE

View File

@ -449,8 +449,8 @@ class Formula
# and then {#stable}'s {#prefix}
# @private
def installed_prefix
if head && (head_prefix = latest_head_prefix) && head_prefix.directory?
head_prefix
if head && (head_version = latest_head_version) && !head_version_outdated?(head_version)
latest_head_prefix
elsif devel && (devel_prefix = prefix(PkgVersion.new(devel.version, revision))).directory?
devel_prefix
elsif stable && (stable_prefix = prefix(PkgVersion.new(stable.version, revision))).directory?