Merge pull request #3707 from MikeMcQuaid/no-deprecations-cache-brew

utils: no deprecations for cached formulae.
This commit is contained in:
Mike McQuaid 2018-01-21 14:50:22 +00:00 committed by GitHub
commit 1c1a1c8d00
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -89,6 +89,9 @@ def odeprecated(method, replacement = nil, disable: false, disable_on: nil, call
true true
end end
caller_message ||= backtrace.detect do |line| caller_message ||= backtrace.detect do |line|
# Don't throw deprecations at all for cached or .brew formulae.
next false if line.include?(HOMEBREW_CACHE)
next false if line.include?("/.brew/")
!line.start_with?("#{HOMEBREW_LIBRARY_PATH}/compat/") !line.start_with?("#{HOMEBREW_LIBRARY_PATH}/compat/")
end end
caller_message ||= backtrace[1] caller_message ||= backtrace[1]