aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Homebrew/requirement.rb
diff options
context:
space:
mode:
Diffstat (limited to 'Library/Homebrew/requirement.rb')
-rw-r--r--Library/Homebrew/requirement.rb6
1 files changed, 5 insertions, 1 deletions
diff --git a/Library/Homebrew/requirement.rb b/Library/Homebrew/requirement.rb
index dfe68c19c..95807d5ae 100644
--- a/Library/Homebrew/requirement.rb
+++ b/Library/Homebrew/requirement.rb
@@ -77,7 +77,11 @@ class Requirement
def satisfied_result_parent
return unless @satisfied_result.is_a?(Pathname)
- @satisfied_result.resolved_path.parent
+ parent = @satisfied_result.resolved_path.parent
+ if parent.to_s =~ %r{^#{Regexp.escape(HOMEBREW_CELLAR)}/([\w+-.@]+)/[^/]+/(s?bin)/?$}
+ parent = HOMEBREW_PREFIX/"opt/#{Regexp.last_match(1)}/#{Regexp.last_match(2)}"
+ end
+ parent
end
# Overriding #modify_build_environment is deprecated.