From 04a64bb7244f26ad227fa0c5914d43620f63bb1b Mon Sep 17 00:00:00 2001 From: Mike McQuaid Date: Wed, 29 Apr 2020 09:34:40 +0100 Subject: [PATCH] formula: disable! deprecates before disable date. This makes more sense to me; if we expect a formula will be disabled at a given point in the future then we should deprecate it immediately. --- Library/Homebrew/formula.rb | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/Library/Homebrew/formula.rb b/Library/Homebrew/formula.rb index c95b9a3bdb..826b880663 100644 --- a/Library/Homebrew/formula.rb +++ b/Library/Homebrew/formula.rb @@ -2637,7 +2637,9 @@ class Formula @pour_bottle_check.instance_eval(&block) end - # Deprecates a {Formula} so a warning is shown on each installation. + # Deprecates a {Formula} (on a given date, if provided) so a warning is + # shown on each installation. If the date has not yet passed the formula + # will not be deprecated. def deprecate!(date: nil) return if date.present? && Date.parse(date) > Date.today @@ -2651,9 +2653,14 @@ class Formula @deprecated == true end - # Disables a {Formula} so it cannot be installed. + # Disables a {Formula} (on a given date, if provided) so it cannot be + # installed. If the date has not yet passed the formula + # will be deprecated instead of disabled. def disable!(date: nil) - return if date.present? && Date.parse(date) > Date.today + if date.present? && Date.parse(date) > Date.today + @deprecated = true + return + end @disabled = true end