utils: no deprecations for cached formulae.

`HOMEBREW_CACHE`d and `.brew`ed formulae cannot be updated so don't
complain about their deprecation.
This commit is contained in:
Mike McQuaid 2018-01-21 13:34:36 +00:00
parent d14fd49b30
commit 5e5989b704

View File

@ -89,6 +89,9 @@ def odeprecated(method, replacement = nil, disable: false, disable_on: nil, call
true
end
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/")
end
caller_message ||= backtrace[1]