From 4bb8becf605ca9cbb7f068cc48b8d785e0d8c946 Mon Sep 17 00:00:00 2001 From: Mike McQuaid Date: Tue, 15 Dec 2020 12:04:28 +0000 Subject: [PATCH] odeprecated: handle deprecated and disabled formulae. It's not useful to spend time complaining about or fixing deprecations or disables in deprecated or disabled formulae given we already complain on install and don't run them through CI. --- Library/Homebrew/utils.rb | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/Library/Homebrew/utils.rb b/Library/Homebrew/utils.rb index d7980f6518..6009e092b2 100644 --- a/Library/Homebrew/utils.rb +++ b/Library/Homebrew/utils.rb @@ -188,9 +188,18 @@ module Kernel # Don't throw deprecations at all for cached, .brew or .metadata files. return if backtrace.any? do |line| - line.include?(HOMEBREW_CACHE) || - line.include?("/.brew/") || - line.include?("/.metadata/") + next true if line.include?(HOMEBREW_CACHE) + next true if line.include?("/.brew/") + next true if line.include?("/.metadata/") + + next false unless line.match?(HOMEBREW_TAP_PATH_REGEX) + + path = Pathname(line.split(":", 2).first) + next false unless path.file? + next false unless path.readable? + + formula_contents = path.read + formula_contents.include?(" deprecate! ") || formula_contents.include?(" disable! ") end tap_message = T.let(nil, T.nilable(String))