Skip to content

Commit

Permalink
Homebrew 4.3.0 deprecation/disable/removals.
Browse files Browse the repository at this point in the history
The usual pass of deprecating/disabling/removing code for the next
minor Homebrew release.
  • Loading branch information
MikeMcQuaid committed May 6, 2024
1 parent 82c2e74 commit a1514aa
Show file tree
Hide file tree
Showing 24 changed files with 53 additions and 445 deletions.
12 changes: 1 addition & 11 deletions Library/Homebrew/cask/dsl.rb
Original file line number Diff line number Diff line change
Expand Up @@ -248,16 +248,6 @@ def url(*args, **options, &block)
end
end

# Sets the cask's appcast URL.
#
# @api public
def appcast(*args, **kwargs)
set_unique_stanza(:appcast, args.empty? && kwargs.empty?) do
odisabled "the `appcast` stanza", "the `livecheck` stanza"
true
end
end

# Sets the cask's container type or nested container path.
#
# ### Examples
Expand Down Expand Up @@ -417,7 +407,7 @@ def caveats(*strings, &block)
end

def discontinued?
# odeprecated "`discontinued?`", "`deprecated?` or `disabled?`"
odeprecated "`discontinued?`", "`deprecated?` or `disabled?`"
@caveats&.discontinued? == true
end

Expand Down
2 changes: 1 addition & 1 deletion Library/Homebrew/cask/dsl/caveats.rb
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ def eval_caveats(&block)
end

caveat :discontinued do
# odeprecated "`caveats :discontinued`", "`deprecate!`"
odeprecated "`caveats :discontinued`", "`deprecate!`"
@discontinued = true
<<~EOS
#{@cask} has been officially discontinued upstream.
Expand Down
4 changes: 0 additions & 4 deletions Library/Homebrew/cask/dsl/postflight.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,6 @@ class DSL
# Class corresponding to the `postflight` stanza.
class Postflight < Base
include Staged

def suppress_move_to_applications(**_options)
odisabled "`Cask::DSL::Postflight#suppress_move_to_applications`"
end
end
end
end
169 changes: 0 additions & 169 deletions Library/Homebrew/cmd/postgresql-upgrade-database.rb

This file was deleted.

129 changes: 13 additions & 116 deletions Library/Homebrew/cmd/update-report.rb
Original file line number Diff line number Diff line change
Expand Up @@ -754,52 +754,20 @@ def empty?
end

def dump(auto_update: false)
report_all = ENV["HOMEBREW_UPDATE_REPORT_ALL_FORMULAE"].present?
if report_all && !Homebrew::EnvConfig.no_install_from_api?
odisabled "`HOMEBREW_UPDATE_REPORT_ALL_FORMULAE`"
opoo "This will not report all formulae because Homebrew cannot get this data from the API."
report_all = false
end

unless Homebrew::EnvConfig.no_update_report_new?
dump_new_formula_report
dump_new_cask_report
end

if report_all
dump_renamed_formula_report
dump_renamed_cask_report
end

dump_deleted_formula_report(report_all)
dump_deleted_cask_report(report_all)

outdated_formulae = []
outdated_casks = []

if report_all
if auto_update
if (changed_formulae = select_formula_or_cask(:M).count) && changed_formulae.positive?
ohai "Modified Formulae",
"Modified #{Utils.pluralize("formula", changed_formulae, plural: "e", include_count: true)}."
end
dump_deleted_formula_report
dump_deleted_cask_report

if (changed_casks = select_formula_or_cask(:MC).count) && changed_casks.positive?
ohai "Modified Casks", "Modified #{Utils.pluralize("cask", changed_casks, include_count: true)}."
end
else
dump_modified_formula_report
dump_modified_cask_report
end
else
outdated_formulae = Formula.installed.select(&:outdated?).map(&:name)
outdated_casks = Cask::Caskroom.casks.select(&:outdated?).map(&:token)
unless auto_update
output_dump_formula_or_cask_report "Outdated Formulae", outdated_formulae
output_dump_formula_or_cask_report "Outdated Casks", outdated_casks
end
outdated_formulae = Formula.installed.select(&:outdated?).map(&:name)
outdated_casks = Cask::Caskroom.casks.select(&:outdated?).map(&:token)
unless auto_update
output_dump_formula_or_cask_report "Outdated Formulae", outdated_formulae
output_dump_formula_or_cask_report "Outdated Casks", outdated_casks
end

return if outdated_formulae.blank? && outdated_casks.blank?

outdated_formulae = outdated_formulae.count
Expand Down Expand Up @@ -853,92 +821,21 @@ def dump_new_cask_report
output_dump_formula_or_cask_report "New Casks", casks
end

def dump_renamed_formula_report
formulae = select_formula_or_cask(:R).sort.map do |name, new_name|
name = pretty_installed(name) if installed?(name)
new_name = pretty_installed(new_name) if installed?(new_name)
"#{name} -> #{new_name}"
end

output_dump_formula_or_cask_report "Renamed Formulae", formulae
end

def dump_renamed_cask_report
casks = select_formula_or_cask(:RC).sort.map do |name, new_name|
name = pretty_installed(name) if installed?(name)
new_name = pretty_installed(new_name) if installed?(new_name)
"#{name} -> #{new_name}"
end

output_dump_formula_or_cask_report "Renamed Casks", casks
end

def dump_deleted_formula_report(report_all)
def dump_deleted_formula_report
formulae = select_formula_or_cask(:D).sort.filter_map do |name|
if installed?(name)
pretty_uninstalled(name)
elsif report_all
name
end
pretty_uninstalled(name) if installed?(name)
end

title = if report_all
"Deleted Formulae"
else
"Deleted Installed Formulae"
end
output_dump_formula_or_cask_report title, formulae
output_dump_formula_or_cask_report "Deleted Installed Formulae", formulae
end

def dump_deleted_cask_report(report_all)
def dump_deleted_cask_report
casks = select_formula_or_cask(:DC).sort.filter_map do |name|
name = name.split("/").last
if cask_installed?(name)
pretty_uninstalled(name)
elsif report_all
name
end
end

title = if report_all
"Deleted Casks"
else
"Deleted Installed Casks"
end
output_dump_formula_or_cask_report title, casks
end

def dump_modified_formula_report
formulae = select_formula_or_cask(:M).sort.map do |name|
if installed?(name)
if outdated?(name)
pretty_outdated(name)
else
pretty_installed(name)
end
else
name
end
end

output_dump_formula_or_cask_report "Modified Formulae", formulae
end

def dump_modified_cask_report
casks = select_formula_or_cask(:MC).sort.map do |name|
name = name.split("/").last
if cask_installed?(name)
if cask_outdated?(name)
pretty_outdated(name)
else
pretty_installed(name)
end
else
name
end
pretty_uninstalled(name) if cask_installed?(name)
end

output_dump_formula_or_cask_report "Modified Casks", casks
output_dump_formula_or_cask_report "Deleted Installed Casks", casks
end

def output_dump_formula_or_cask_report(title, formulae_or_casks)
Expand Down
4 changes: 2 additions & 2 deletions Library/Homebrew/cmd/upgrade.rb
Original file line number Diff line number Diff line change
Expand Up @@ -124,8 +124,8 @@ class UpgradeCmd < AbstractCommand

sig { override.void }
def run
# Deprecated since this is now the default behavior.
odeprecated "`brew upgrade --ignore-pinned`" if args.ignore_pinned?
# Disabled since this is now the default behavior.
odisabled "`brew upgrade --ignore-pinned`" if args.ignore_pinned?

formulae, casks = args.named.to_resolved_formulae_to_casks
# If one or more formulae are specified, but no casks were
Expand Down
Loading

0 comments on commit a1514aa

Please sign in to comment.