Homebrew 4.3.0 deprecation/disable/removals.
The usual pass of deprecating/disabling/removing code for the next minor Homebrew release.
This commit is contained in:
parent
621dce827e
commit
222fe8ef0b
@ -112,7 +112,6 @@ Layout/LineLength:
|
||||
' url "',
|
||||
' mirror "',
|
||||
" plist_options ",
|
||||
' appcast "',
|
||||
' executable: "',
|
||||
' font "',
|
||||
' homepage "',
|
||||
|
@ -289,7 +289,7 @@ module Cask
|
||||
|
||||
sig { params(livecheck_result: T.any(NilClass, T::Boolean, Symbol)).void }
|
||||
def audit_hosting_with_livecheck(livecheck_result: audit_livecheck_version)
|
||||
return if cask.discontinued? || cask.deprecated? || cask.disabled?
|
||||
return if cask.deprecated? || cask.disabled?
|
||||
return if cask.version&.latest?
|
||||
return unless cask.url
|
||||
return if block_url_offline?
|
||||
@ -682,7 +682,7 @@ module Cask
|
||||
sig { void }
|
||||
def audit_github_repository_archived
|
||||
# Deprecated/disabled casks may have an archived repository.
|
||||
return if cask.discontinued? || cask.deprecated? || cask.disabled?
|
||||
return if cask.deprecated? || cask.disabled?
|
||||
|
||||
user, repo = get_repo_data(%r{https?://github\.com/([^/]+)/([^/]+)/?.*}) if online?
|
||||
return if user.nil?
|
||||
@ -696,7 +696,7 @@ module Cask
|
||||
sig { void }
|
||||
def audit_gitlab_repository_archived
|
||||
# Deprecated/disabled casks may have an archived repository.
|
||||
return if cask.discontinued? || cask.deprecated? || cask.disabled?
|
||||
return if cask.deprecated? || cask.disabled?
|
||||
|
||||
user, repo = get_repo_data(%r{https?://gitlab\.com/([^/]+)/([^/]+)/?.*}) if online?
|
||||
return if user.nil?
|
||||
|
@ -352,7 +352,6 @@ module Cask
|
||||
"homepage" => homepage,
|
||||
"url" => url,
|
||||
"url_specs" => url_specs,
|
||||
"appcast" => appcast,
|
||||
"version" => version,
|
||||
"installed" => installed_version,
|
||||
"installed_time" => install_time&.to_i,
|
||||
|
@ -2,8 +2,6 @@
|
||||
|
||||
module Cask
|
||||
class Cask
|
||||
def appcast; end
|
||||
|
||||
def appdir; end
|
||||
|
||||
def artifacts; end
|
||||
|
@ -315,7 +315,6 @@ module Cask
|
||||
end
|
||||
|
||||
url json_cask[:url], **json_cask.fetch(:url_specs, {}) if json_cask[:url].present?
|
||||
appcast json_cask[:appcast] if json_cask[:appcast].present?
|
||||
json_cask[:name]&.each do |cask_name|
|
||||
name cask_name
|
||||
end
|
||||
|
@ -248,16 +248,6 @@ module Cask
|
||||
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
|
||||
@ -417,7 +407,7 @@ module Cask
|
||||
end
|
||||
|
||||
def discontinued?
|
||||
# odeprecated "`discontinued?`", "`deprecated?` or `disabled?`"
|
||||
odeprecated "`discontinued?`", "`deprecated?` or `disabled?`"
|
||||
@caveats&.discontinued? == true
|
||||
end
|
||||
|
||||
|
@ -164,7 +164,7 @@ module Cask
|
||||
end
|
||||
|
||||
caveat :discontinued do
|
||||
# odeprecated "`caveats :discontinued`", "`deprecate!`"
|
||||
odeprecated "`caveats :discontinued`", "`deprecate!`"
|
||||
@discontinued = true
|
||||
<<~EOS
|
||||
#{@cask} has been officially discontinued upstream.
|
||||
|
@ -8,10 +8,6 @@ module Cask
|
||||
# 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
|
||||
|
@ -152,15 +152,11 @@ class Caveats
|
||||
end
|
||||
|
||||
def service_caveats
|
||||
return if !formula.plist && !formula.service? && !Utils::Service.installed?(formula) && !keg&.plist_installed?
|
||||
return if !formula.service? && !Utils::Service.installed?(formula) && !keg&.plist_installed?
|
||||
return if formula.service? && !formula.service.command? && !Utils::Service.installed?(formula)
|
||||
|
||||
s = []
|
||||
|
||||
return <<~EOS if !Utils::Service.launchctl? && formula.plist
|
||||
#{Formatter.warning("Warning:")} #{formula.name} provides a launchd plist which can only be used on macOS!
|
||||
EOS
|
||||
|
||||
# Brew services only works with these two tools
|
||||
return <<~EOS if !Utils::Service.systemctl? && !Utils::Service.launchctl? && formula.service.command?
|
||||
#{Formatter.warning("Warning:")} #{formula.name} provides a service which can only be used on macOS or systemd!
|
||||
|
@ -1,169 +0,0 @@
|
||||
# typed: strict
|
||||
# frozen_string_literal: true
|
||||
|
||||
require "abstract_command"
|
||||
require "formula"
|
||||
|
||||
module Homebrew
|
||||
module Cmd
|
||||
class PostgresqlUpgradeDatabase < AbstractCommand
|
||||
cmd_args do
|
||||
description <<~EOS
|
||||
Upgrades the database for the `postgresql` formula.
|
||||
EOS
|
||||
|
||||
named_args :none
|
||||
|
||||
hide_from_man_page!
|
||||
end
|
||||
|
||||
sig { override.void }
|
||||
def run
|
||||
odisabled "brew postgresql_upgrade_database",
|
||||
"using new, versioned e.g. `var/postgres@14` datadir and `pg_upgrade`"
|
||||
|
||||
name = "postgresql"
|
||||
pg = Formula[name]
|
||||
bin = pg.bin
|
||||
var = pg.var
|
||||
version = pg.version
|
||||
pg_version_file = var/"postgres/PG_VERSION"
|
||||
|
||||
pg_version_installed = version.to_s[/^\d+/]
|
||||
pg_version_data = pg_version_file.read.chomp
|
||||
if pg_version_installed == pg_version_data
|
||||
odie <<~EOS
|
||||
#{name} data already upgraded!
|
||||
EOS
|
||||
end
|
||||
|
||||
datadir = var/"postgres"
|
||||
old_datadir = var/"postgres.old"
|
||||
if old_datadir.exist?
|
||||
odie <<~EOS
|
||||
#{old_datadir} already exists!
|
||||
Remove it if you want to upgrade data automatically.
|
||||
EOS
|
||||
end
|
||||
|
||||
old_pg_name = "#{name}@#{pg_version_data}"
|
||||
old_pg_glob = "#{HOMEBREW_CELLAR}/#{old_pg_name}/#{pg_version_data}.*/bin"
|
||||
old_bin = Pathname.glob(old_pg_glob).first
|
||||
old_bin ||= begin
|
||||
Formula[old_pg_name]
|
||||
ohai "brew install #{old_pg_name}"
|
||||
system HOMEBREW_BREW_FILE, "install", old_pg_name
|
||||
Pathname.glob(old_pg_glob).first
|
||||
rescue FormulaUnavailableError
|
||||
nil
|
||||
end
|
||||
|
||||
odie "No #{name} #{pg_version_data}.* version installed!" unless old_bin
|
||||
|
||||
server_stopped = T.let(false, T::Boolean)
|
||||
moved_data = T.let(false, T::Boolean)
|
||||
initdb_run = T.let(false, T::Boolean)
|
||||
upgraded = T.let(false, T::Boolean)
|
||||
|
||||
begin
|
||||
# Following instructions from:
|
||||
# https://www.postgresql.org/docs/10/static/pgupgrade.html
|
||||
ohai "Upgrading #{name} data from #{pg_version_data} to #{pg_version_installed}..."
|
||||
services_json_output = Utils.popen_read(HOMEBREW_BREW_FILE, "services", "info", "--all", "--json")
|
||||
services_json = JSON.parse(services_json_output)
|
||||
loaded_service_names = services_json.select { |sj| sj[:loaded] }.map { |sj| sj[:name] }
|
||||
if loaded_service_names.include?(name)
|
||||
system HOMEBREW_BREW_FILE, "services", "stop", name
|
||||
service_stopped = true
|
||||
elsif quiet_system "#{bin}/pg_ctl", "-D", datadir, "status"
|
||||
system "#{bin}/pg_ctl", "-D", datadir, "stop"
|
||||
server_stopped = true
|
||||
end
|
||||
|
||||
# Shut down old server if it is up via brew services
|
||||
system HOMEBREW_BREW_FILE, "services", "stop", old_pg_name if loaded_service_names.include?(old_pg_name)
|
||||
|
||||
# get 'lc_collate' from old DB"
|
||||
unless quiet_system "#{old_bin}/pg_ctl", "-w", "-D", datadir, "status"
|
||||
system "#{old_bin}/pg_ctl", "-w", "-D", datadir, "start"
|
||||
end
|
||||
|
||||
initdb_args = T.let([], T::Array[String])
|
||||
locale_settings = %w[
|
||||
lc_collate
|
||||
lc_ctype
|
||||
lc_messages
|
||||
lc_monetary
|
||||
lc_numeric
|
||||
lc_time
|
||||
server_encoding
|
||||
]
|
||||
locale_settings.each do |setting|
|
||||
sql = "SELECT setting FROM pg_settings WHERE name LIKE '#{setting}';"
|
||||
value = Utils.popen_read("#{old_bin}/psql", "postgres", "-qtAX", "-U", ENV.fetch("USER"), "-c",
|
||||
sql).strip
|
||||
|
||||
next if value.empty?
|
||||
|
||||
initdb_args += if setting == "server_encoding"
|
||||
["-E #{value}"]
|
||||
else
|
||||
["--#{setting.tr("_", "-")}=#{value}"]
|
||||
end
|
||||
end
|
||||
|
||||
if quiet_system "#{old_bin}/pg_ctl", "-w", "-D", datadir, "status"
|
||||
system "#{old_bin}/pg_ctl", "-w", "-D", datadir, "stop"
|
||||
end
|
||||
|
||||
ohai "Moving #{name} data from #{datadir} to #{old_datadir}..."
|
||||
FileUtils.mv datadir, old_datadir
|
||||
moved_data = true
|
||||
|
||||
(var/"postgres").mkpath
|
||||
ohai "Creating database..."
|
||||
safe_system "#{bin}/initdb", *initdb_args, "#{var}/postgres"
|
||||
initdb_run = true
|
||||
|
||||
ohai "Migrating and upgrading data..."
|
||||
(var/"log").cd do
|
||||
safe_system "#{bin}/pg_upgrade",
|
||||
"-r",
|
||||
"-b", old_bin,
|
||||
"-B", bin,
|
||||
"-d", old_datadir,
|
||||
"-D", datadir,
|
||||
"-j", Hardware::CPU.cores.to_s
|
||||
end
|
||||
upgraded = true
|
||||
|
||||
ohai "Upgraded #{name} data from #{pg_version_data} to #{pg_version_installed}!"
|
||||
ohai "Your #{name} #{pg_version_data} data remains at #{old_datadir}"
|
||||
ensure
|
||||
if upgraded
|
||||
if server_stopped
|
||||
safe_system "#{bin}/pg_ctl", "-D", datadir, "start"
|
||||
elsif service_stopped
|
||||
safe_system HOMEBREW_BREW_FILE, "services", "start", name
|
||||
end
|
||||
else
|
||||
onoe "Upgrading #{name} data from #{pg_version_data} to #{pg_version_installed} failed!"
|
||||
if initdb_run
|
||||
ohai "Removing empty #{name} initdb database..."
|
||||
FileUtils.rm_r datadir
|
||||
end
|
||||
if moved_data
|
||||
ohai "Moving #{name} data back from #{old_datadir} to #{datadir}..."
|
||||
FileUtils.mv old_datadir, datadir
|
||||
end
|
||||
if server_stopped
|
||||
system "#{bin}/pg_ctl", "-D", datadir, "start"
|
||||
elsif service_stopped
|
||||
system HOMEBREW_BREW_FILE, "services", "start", name
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
@ -754,52 +754,20 @@ class ReporterHub
|
||||
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
|
||||
dump_deleted_formula_report
|
||||
dump_deleted_cask_report
|
||||
|
||||
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
|
||||
|
||||
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
|
||||
|
||||
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
|
||||
end
|
||||
|
||||
return if outdated_formulae.blank? && outdated_casks.blank?
|
||||
|
||||
outdated_formulae = outdated_formulae.count
|
||||
@ -853,92 +821,21 @@ class ReporterHub
|
||||
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
|
||||
pretty_uninstalled(name) if cask_installed?(name)
|
||||
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
|
||||
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)
|
||||
|
@ -124,8 +124,8 @@ module Homebrew
|
||||
|
||||
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
|
||||
|
@ -50,13 +50,11 @@ module Homebrew
|
||||
"`--strict` and `--online`."
|
||||
switch "--new-formula",
|
||||
replacement: "--new",
|
||||
# odeprecated: change this to true on disable and remove `args.new_formula?` calls
|
||||
disable: false,
|
||||
disable: true,
|
||||
hidden: true
|
||||
switch "--new-cask",
|
||||
replacement: "--new",
|
||||
# odeprecated: change this to true on disable and remove `args.new_formula?` calls
|
||||
disable: false,
|
||||
disable: true,
|
||||
hidden: true
|
||||
switch "--[no-]signing",
|
||||
description: "Audit for signed apps, which are required on ARM"
|
||||
@ -105,9 +103,6 @@ module Homebrew
|
||||
|
||||
sig { override.void }
|
||||
def run
|
||||
new_cask = args.new? || args.new_cask?
|
||||
new_formula = args.new? || args.new_formula?
|
||||
|
||||
Formulary.enable_factory_cache!
|
||||
|
||||
os_arch_combinations = args.os_arch_combinations
|
||||
@ -115,8 +110,8 @@ module Homebrew
|
||||
Homebrew.auditing = true
|
||||
Homebrew.inject_dump_stats!(FormulaAuditor, /^audit_/) if args.audit_debug?
|
||||
|
||||
strict = new_formula || args.strict?
|
||||
online = new_formula || args.online?
|
||||
strict = args.new? || args.strict?
|
||||
online = args.new? || args.online?
|
||||
tap_audit = args.tap.present?
|
||||
skip_style = args.skip_style? || args.no_named? || tap_audit
|
||||
no_named_args = T.let(false, T::Boolean)
|
||||
@ -176,7 +171,7 @@ module Homebrew
|
||||
|
||||
if only_cops
|
||||
style_options[:only_cops] = only_cops
|
||||
elsif new_formula || new_cask
|
||||
elsif args.new?
|
||||
nil
|
||||
elsif except_cops
|
||||
style_options[:except_cops] = except_cops
|
||||
@ -207,7 +202,7 @@ module Homebrew
|
||||
|
||||
only = only_cops ? ["style"] : args.only
|
||||
options = {
|
||||
new_formula:,
|
||||
new_formula: args.new?,
|
||||
strict:,
|
||||
online:,
|
||||
git: args.git?,
|
||||
@ -262,7 +257,7 @@ module Homebrew
|
||||
# No need for `|| nil` for `--[no-]signing`
|
||||
# because boolean switches are already `nil` if not passed
|
||||
audit_signing: args.signing?,
|
||||
audit_new_cask: new_cask || nil,
|
||||
audit_new_cask: args.new? || nil,
|
||||
audit_token_conflicts: args.token_conflicts? || nil,
|
||||
quarantine: true,
|
||||
any_named_args: !no_named_args,
|
||||
|
@ -49,8 +49,6 @@ module Homebrew
|
||||
description: "Specify the <SHA-256> checksum of the new download."
|
||||
flag "--fork-org=",
|
||||
description: "Use the specified GitHub organization for forking."
|
||||
switch "-f", "--force",
|
||||
hidden: true
|
||||
|
||||
conflicts "--dry-run", "--write"
|
||||
conflicts "--no-audit", "--online"
|
||||
@ -62,8 +60,7 @@ module Homebrew
|
||||
|
||||
sig { override.void }
|
||||
def run
|
||||
odeprecated "brew bump-cask-pr --online" if args.online?
|
||||
odisabled "brew bump-cask-pr --force" if args.force?
|
||||
odisabled "brew bump-cask-pr --online" if args.online?
|
||||
|
||||
# This will be run by `brew audit` or `brew style` later so run it first to
|
||||
# not start spamming during normal output.
|
||||
|
@ -475,7 +475,7 @@ module Homebrew
|
||||
def check_throttle(formula, new_version)
|
||||
throttled_rate = formula.livecheck.throttle
|
||||
throttled_rate ||= if (rate = formula.tap.audit_exceptions.dig(:throttled_formulae, formula.name))
|
||||
odeprecated "throttled_formulae.json", "Livecheck#throttle"
|
||||
odisabled "throttled_formulae.json", "Livecheck#throttle"
|
||||
rate
|
||||
end
|
||||
return if throttled_rate.blank?
|
||||
|
@ -44,7 +44,7 @@ module Homebrew
|
||||
casks = args.named.to_paths(only: :cask, recurse_tap: true).map { |path| Cask::CaskLoader.load(path) }
|
||||
|
||||
unversioned_casks = casks.select do |cask|
|
||||
cask.url&.unversioned? && !cask.livecheckable? && !cask.discontinued?
|
||||
cask.url&.unversioned? && !cask.livecheckable?
|
||||
end
|
||||
|
||||
ohai "Unversioned Casks: #{unversioned_casks.count} (#{state.size} cached)"
|
||||
|
@ -45,8 +45,6 @@ module Homebrew
|
||||
description: "Limit number of package results returned."
|
||||
flag "--start-with=",
|
||||
description: "Letter or word that the list of package results should alphabetically follow."
|
||||
switch "-f", "--force",
|
||||
hidden: true
|
||||
|
||||
conflicts "--cask", "--formula"
|
||||
conflicts "--tap=", "--installed"
|
||||
@ -63,8 +61,6 @@ module Homebrew
|
||||
raise UsageError, "`--limit` must be used with either `--formula` or `--cask`."
|
||||
end
|
||||
|
||||
odisabled "brew bump --force" if args.force?
|
||||
|
||||
Homebrew.with_no_api_env do
|
||||
formulae_and_casks = if args.tap
|
||||
tap = Tap.fetch(T.must(args.tap))
|
||||
|
@ -120,19 +120,7 @@ module Homebrew
|
||||
private
|
||||
|
||||
def watchlist_path
|
||||
@watchlist_path ||= begin
|
||||
watchlist = File.expand_path(Homebrew::EnvConfig.livecheck_watchlist)
|
||||
|
||||
unless File.exist?(watchlist)
|
||||
previous_default_watchlist = File.expand_path("~/.brew_livecheck_watchlist")
|
||||
if File.exist?(previous_default_watchlist)
|
||||
odisabled "~/.brew_livecheck_watchlist", "~/.homebrew/livecheck_watchlist.txt"
|
||||
watchlist = previous_default_watchlist
|
||||
end
|
||||
end
|
||||
|
||||
watchlist
|
||||
end
|
||||
@watchlist_path ||= File.expand_path(Homebrew::EnvConfig.livecheck_watchlist)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
@ -28,11 +28,6 @@ module Homebrew
|
||||
switch "--autosquash",
|
||||
description: "Instruct `brew pr-publish` to automatically reformat and reword commits " \
|
||||
"in the pull request to the preferred format."
|
||||
switch "--no-autosquash",
|
||||
description: "Instruct `brew pr-publish` to skip automatically reformatting and rewording commits " \
|
||||
"in the pull request to the preferred format.",
|
||||
disable: true, # odisabled: remove this switch with 4.3.0
|
||||
hidden: true
|
||||
switch "--ignore-failures",
|
||||
description: "Include pull requests that have failing status checks."
|
||||
|
||||
|
@ -35,11 +35,6 @@ module Homebrew
|
||||
switch "--autosquash",
|
||||
description: "Automatically reformat and reword commits in the pull request to our " \
|
||||
"preferred format."
|
||||
switch "--no-autosquash",
|
||||
description: "Skip automatically reformatting and rewording commits in the pull request to our " \
|
||||
"preferred format.",
|
||||
disable: true, # odisabled: remove this switch with 4.3.0
|
||||
hidden: true
|
||||
switch "--branch-okay",
|
||||
description: "Do not warn if pulling to a branch besides the repository default (useful for testing)."
|
||||
switch "--resolve",
|
||||
|
@ -79,7 +79,7 @@ class AbstractDownloadStrategy
|
||||
# Disable any output during downloading.
|
||||
sig { void }
|
||||
def shutup!
|
||||
odeprecated "`AbstractDownloadStrategy#shutup!`", "`AbstractDownloadStrategy#quiet!`"
|
||||
odisabled "`AbstractDownloadStrategy#shutup!`", "`AbstractDownloadStrategy#quiet!`"
|
||||
quiet!
|
||||
end
|
||||
|
||||
|
@ -565,13 +565,6 @@ class Formula
|
||||
}
|
||||
def resource(name, klass = Resource, &block) = active_spec.resource(name, klass, &block)
|
||||
|
||||
# An old name for the formula.
|
||||
sig { returns(T.nilable(String)) }
|
||||
def oldname
|
||||
odisabled "`Formula#oldname`", "`Formula#oldnames`"
|
||||
@oldname ||= oldnames.first
|
||||
end
|
||||
|
||||
# Old names for the formula.
|
||||
#
|
||||
# @api internal
|
||||
@ -605,16 +598,6 @@ class Formula
|
||||
# The declared {Dependency}s for the currently active {SoftwareSpec} (i.e. including those provided by macOS)
|
||||
delegate declared_deps: :active_spec
|
||||
|
||||
# Dependencies provided by macOS for the currently active {SoftwareSpec}.
|
||||
def uses_from_macos_elements
|
||||
odisabled "`Formula#uses_from_macos_elements`", "`Formula#declared_deps`"
|
||||
end
|
||||
|
||||
# Dependency names provided by macOS for the currently active {SoftwareSpec}.
|
||||
def uses_from_macos_names
|
||||
odisabled "`Formula#uses_from_macos_names`", "`Formula#declared_deps`"
|
||||
end
|
||||
|
||||
# The {Requirement}s for the currently active {SoftwareSpec}.
|
||||
delegate requirements: :active_spec
|
||||
|
||||
@ -1241,8 +1224,7 @@ class Formula
|
||||
#
|
||||
# @see https://www.unix.com/man-page/all/5/plist/ <code>plist(5)</code> man page
|
||||
def plist
|
||||
# odeprecated: consider removing entirely in 4.3.0
|
||||
# odeprecated "`Formula#plist`", "`Homebrew::Service`"
|
||||
odeprecated "`Formula#plist`", "`Homebrew::Service`"
|
||||
nil
|
||||
end
|
||||
|
||||
@ -2401,7 +2383,7 @@ class Formula
|
||||
"name" => name,
|
||||
"full_name" => full_name,
|
||||
"tap" => tap&.name,
|
||||
"oldname" => oldnames.first, # deprecated
|
||||
"oldname" => ("odeprecated" if oldnames.first),
|
||||
"oldnames" => oldnames,
|
||||
"aliases" => aliases.sort,
|
||||
"versioned_formulae" => versioned_formulae.map(&:name),
|
||||
@ -3731,7 +3713,7 @@ class Formula
|
||||
#
|
||||
# @api public
|
||||
def go_resource(name, &block)
|
||||
# odeprecated "`Formula.go_resource`", "Go modules"
|
||||
odeprecated "`Formula.go_resource`", "Go modules"
|
||||
specs.each { |spec| spec.go_resource(name, &block) }
|
||||
end
|
||||
|
||||
|
@ -427,7 +427,7 @@ module FormulaCellarChecks
|
||||
problem_if_output(check_elisp_root(formula.share, formula.name))
|
||||
problem_if_output(check_python_packages(formula.lib, formula.deps))
|
||||
problem_if_output(check_shim_references(formula.prefix))
|
||||
problem_if_output(check_plist(formula.prefix, formula.plist))
|
||||
problem_if_output(check_plist(formula.prefix, formula.launchd_service_path))
|
||||
problem_if_output(check_python_symlinks(formula.name, formula.keg_only?))
|
||||
problem_if_output(check_cpuid_instruction(formula))
|
||||
problem_if_output(check_binary_arches(formula))
|
||||
|
@ -1049,12 +1049,7 @@ on_request: installed_on_request?, options:)
|
||||
|
||||
sig { void }
|
||||
def install_service
|
||||
if formula.service? && formula.plist
|
||||
ofail "Formula specified both service and plist"
|
||||
return
|
||||
end
|
||||
|
||||
if formula.service? && formula.service.command?
|
||||
service = if formula.service? && formula.service.command?
|
||||
service_path = formula.systemd_service_path
|
||||
service_path.atomic_write(formula.service.to_systemd_unit)
|
||||
service_path.chmod 0644
|
||||
@ -1064,14 +1059,9 @@ on_request: installed_on_request?, options:)
|
||||
timer_path.atomic_write(formula.service.to_systemd_timer)
|
||||
timer_path.chmod 0644
|
||||
end
|
||||
end
|
||||
|
||||
service = if formula.service? && formula.service.command?
|
||||
formula.service.to_plist
|
||||
elsif formula.plist
|
||||
formula.plist
|
||||
end
|
||||
|
||||
return unless service
|
||||
|
||||
launchd_service_path = formula.launchd_service_path
|
||||
|
@ -125,8 +125,8 @@ class GitHubPackages
|
||||
def self.image_version_rebuild(version_rebuild)
|
||||
return version_rebuild if version_rebuild.match?(VALID_OCI_TAG_REGEX)
|
||||
|
||||
odeprecated "GitHub Packages versions that do not match #{VALID_OCI_TAG_REGEX.source}",
|
||||
"declaring a new `version` without these characters"
|
||||
odisabled "GitHub Packages versions that do not match #{VALID_OCI_TAG_REGEX.source}",
|
||||
"declaring a new `version` without these characters"
|
||||
version_rebuild.gsub(INVALID_OCI_TAG_CHARS_REGEX, ".")
|
||||
end
|
||||
|
||||
|
@ -14,7 +14,7 @@ module Language
|
||||
# e.g. `resource "github.com/foo/bar"`.
|
||||
sig { params(resources: T::Array[Resource], target: T.any(String, Pathname)).void }
|
||||
def self.stage_deps(resources, target)
|
||||
# odeprecated "`Language::Go.stage_deps`", "Go modules"
|
||||
odeprecated "`Language::Go.stage_deps`", "Go modules"
|
||||
if resources.empty?
|
||||
if Homebrew::EnvConfig.developer?
|
||||
odie "Tried to stage empty Language::Go resources array"
|
||||
|
@ -107,20 +107,6 @@ module Homebrew
|
||||
Livecheck.status_hash(formula, "versioned", full_name:, verbose:)
|
||||
end
|
||||
|
||||
sig {
|
||||
params(
|
||||
cask: Cask::Cask,
|
||||
livecheckable: T::Boolean,
|
||||
full_name: T::Boolean,
|
||||
verbose: T::Boolean,
|
||||
).returns(Hash)
|
||||
}
|
||||
def cask_discontinued(cask, livecheckable, full_name: false, verbose: false)
|
||||
return {} if !cask.discontinued? || livecheckable
|
||||
|
||||
Livecheck.status_hash(cask, "discontinued", full_name:, verbose:)
|
||||
end
|
||||
|
||||
sig {
|
||||
params(
|
||||
cask: Cask::Cask,
|
||||
@ -210,7 +196,6 @@ module Homebrew
|
||||
# Skip conditions for casks.
|
||||
CASK_CHECKS = [
|
||||
:package_or_resource_skip,
|
||||
:cask_discontinued,
|
||||
:cask_deprecated,
|
||||
:cask_disabled,
|
||||
:cask_extract_plist,
|
||||
|
@ -136,40 +136,3 @@ class MacOSVersion < Version
|
||||
# NOTE: Constructor needs to called with an arbitrary macOS-like version which is then set to `nil`.
|
||||
NULL = MacOSVersion.new("10.0").tap { |v| v.instance_variable_set(:@version, nil) }.freeze
|
||||
end
|
||||
|
||||
require "lazy_object"
|
||||
|
||||
module MacOSVersionErrorCompat
|
||||
def const_missing(name)
|
||||
if name == :MacOSVersionError
|
||||
odisabled "`MacOSVersionError`", "`MacOSVersion::Error`"
|
||||
return MacOSVersion::Error
|
||||
end
|
||||
|
||||
super
|
||||
end
|
||||
end
|
||||
|
||||
# `LazyObject` does not work for exceptions when used in `rescue` statements.
|
||||
class Object
|
||||
class << self
|
||||
prepend MacOSVersionErrorCompat
|
||||
end
|
||||
end
|
||||
|
||||
module MacOSVersions
|
||||
SYMBOLS = LazyObject.new do # rubocop:disable Style/MutableConstant
|
||||
odisabled "`MacOSVersions::SYMBOLS`", "`MacOSVersion::SYMBOLS`"
|
||||
MacOSVersion::SYMBOLS
|
||||
end
|
||||
end
|
||||
|
||||
module OS
|
||||
module Mac
|
||||
# TODO: Replace `::Version` with `Version` when this is removed.
|
||||
Version = LazyObject.new do # rubocop:disable Style/MutableConstant
|
||||
odisabled "`OS::Mac::Version`", "`MacOSVersion`"
|
||||
MacOSVersion
|
||||
end
|
||||
end
|
||||
end
|
||||
|
@ -58,60 +58,60 @@ module OS
|
||||
raise "Loaded OS::Linux on generic OS!" if ENV["HOMEBREW_TEST_GENERIC_OS"]
|
||||
|
||||
def self.version
|
||||
odeprecated "`MacOS.version` on Linux"
|
||||
odisabled "`MacOS.version` on Linux"
|
||||
MacOSVersion::NULL
|
||||
end
|
||||
|
||||
def self.full_version
|
||||
odeprecated "`MacOS.full_version` on Linux"
|
||||
odisabled "`MacOS.full_version` on Linux"
|
||||
MacOSVersion::NULL
|
||||
end
|
||||
|
||||
def self.languages
|
||||
odeprecated "`MacOS.languages` on Linux"
|
||||
odisabled "`MacOS.languages` on Linux"
|
||||
@languages ||= Array(ENV["LANG"]&.slice(/[a-z]+/)).uniq
|
||||
end
|
||||
|
||||
def self.language
|
||||
odeprecated "`MacOS.language` on Linux"
|
||||
odisabled "`MacOS.language` on Linux"
|
||||
languages.first
|
||||
end
|
||||
|
||||
def self.sdk_root_needed?
|
||||
odeprecated "`MacOS.sdk_root_needed?` on Linux"
|
||||
odisabled "`MacOS.sdk_root_needed?` on Linux"
|
||||
false
|
||||
end
|
||||
|
||||
def self.sdk_path_if_needed(_version = nil)
|
||||
odeprecated "`MacOS.sdk_path_if_needed` on Linux"
|
||||
odisabled "`MacOS.sdk_path_if_needed` on Linux"
|
||||
nil
|
||||
end
|
||||
|
||||
def self.sdk_path(_version = nil)
|
||||
odeprecated "`MacOS.sdk_path` on Linux"
|
||||
odisabled "`MacOS.sdk_path` on Linux"
|
||||
nil
|
||||
end
|
||||
|
||||
module Xcode
|
||||
def self.version
|
||||
odeprecated "`MacOS::Xcode.version` on Linux"
|
||||
odisabled "`MacOS::Xcode.version` on Linux"
|
||||
::Version::NULL
|
||||
end
|
||||
|
||||
def self.installed?
|
||||
odeprecated "`MacOS::Xcode.installed?` on Linux"
|
||||
odisabled "`MacOS::Xcode.installed?` on Linux"
|
||||
false
|
||||
end
|
||||
end
|
||||
|
||||
module CLT
|
||||
def self.version
|
||||
odeprecated "`MacOS::CLT.version` on Linux"
|
||||
odisabled "`MacOS::CLT.version` on Linux"
|
||||
::Version::NULL
|
||||
end
|
||||
|
||||
def self.installed?
|
||||
odeprecated "`MacOS::CLT.installed?` on Linux"
|
||||
odisabled "`MacOS::CLT.installed?` on Linux"
|
||||
false
|
||||
end
|
||||
end
|
||||
|
@ -26,7 +26,7 @@ module OS
|
||||
# @api internal
|
||||
sig { returns(MacOSVersion) }
|
||||
def self.version
|
||||
odeprecated "`MacOS.version` on Linux" if Homebrew::SimulateSystem.simulating_or_running_on_linux?
|
||||
odisabled "`MacOS.version` on Linux" if Homebrew::SimulateSystem.simulating_or_running_on_linux?
|
||||
@version ||= full_version.strip_patch
|
||||
end
|
||||
|
||||
@ -36,7 +36,7 @@ module OS
|
||||
# @api internal
|
||||
sig { returns(MacOSVersion) }
|
||||
def self.full_version
|
||||
odeprecated "`MacOS.full_version` on Linux" if Homebrew::SimulateSystem.simulating_or_running_on_linux?
|
||||
odisabled "`MacOS.full_version` on Linux" if Homebrew::SimulateSystem.simulating_or_running_on_linux?
|
||||
@full_version ||= if (fake_macos = ENV.fetch("HOMEBREW_FAKE_MACOS", nil)) # for Portable Ruby building
|
||||
MacOSVersion.new(fake_macos)
|
||||
else
|
||||
@ -69,7 +69,7 @@ module OS
|
||||
end
|
||||
|
||||
def self.languages
|
||||
odeprecated "`MacOS.languages` on Linux" if Homebrew::SimulateSystem.simulating_or_running_on_linux?
|
||||
odisabled "`MacOS.languages` on Linux" if Homebrew::SimulateSystem.simulating_or_running_on_linux?
|
||||
return @languages if @languages
|
||||
|
||||
os_langs = Utils.popen_read("defaults", "read", "-g", "AppleLanguages")
|
||||
@ -83,7 +83,7 @@ module OS
|
||||
end
|
||||
|
||||
def self.language
|
||||
odeprecated "`MacOS.language` on Linux" if Homebrew::SimulateSystem.simulating_or_running_on_linux?
|
||||
odisabled "`MacOS.language` on Linux" if Homebrew::SimulateSystem.simulating_or_running_on_linux?
|
||||
languages.first
|
||||
end
|
||||
|
||||
@ -94,7 +94,7 @@ module OS
|
||||
|
||||
sig { returns(T::Boolean) }
|
||||
def self.sdk_root_needed?
|
||||
odeprecated "`MacOS.sdk_root_needed?` on Linux" if Homebrew::SimulateSystem.simulating_or_running_on_linux?
|
||||
odisabled "`MacOS.sdk_root_needed?` on Linux" if Homebrew::SimulateSystem.simulating_or_running_on_linux?
|
||||
if MacOS::CLT.installed?
|
||||
# If there's no CLT SDK, return false
|
||||
return false unless MacOS::CLT.provides_sdk?
|
||||
@ -143,13 +143,13 @@ module OS
|
||||
|
||||
# Returns the path to an SDK or nil, following the rules set by {sdk}.
|
||||
def self.sdk_path(version = nil)
|
||||
odeprecated "`MacOS.sdk_path` on Linux" if Homebrew::SimulateSystem.simulating_or_running_on_linux?
|
||||
odisabled "`MacOS.sdk_path` on Linux" if Homebrew::SimulateSystem.simulating_or_running_on_linux?
|
||||
s = sdk(version)
|
||||
s&.path
|
||||
end
|
||||
|
||||
def self.sdk_path_if_needed(version = nil)
|
||||
odeprecated "`MacOS.sdk_path_if_needed` on Linux" if Homebrew::SimulateSystem.simulating_or_running_on_linux?
|
||||
odisabled "`MacOS.sdk_path_if_needed` on Linux" if Homebrew::SimulateSystem.simulating_or_running_on_linux?
|
||||
# Prefer CLT SDK when both Xcode and the CLT are installed.
|
||||
# Expected results:
|
||||
# 1. On Xcode-only systems, return the Xcode SDK.
|
||||
|
@ -123,7 +123,7 @@ module OS
|
||||
|
||||
sig { returns(T::Boolean) }
|
||||
def self.installed?
|
||||
odeprecated "`MacOS::Xcode.installed?` on Linux" if Homebrew::SimulateSystem.simulating_or_running_on_linux?
|
||||
odisabled "`MacOS::Xcode.installed?` on Linux" if Homebrew::SimulateSystem.simulating_or_running_on_linux?
|
||||
!prefix.nil?
|
||||
end
|
||||
|
||||
@ -175,7 +175,7 @@ module OS
|
||||
# @api internal
|
||||
sig { returns(::Version) }
|
||||
def self.version
|
||||
odeprecated "`MacOS::Xcode.version` on Linux" if Homebrew::SimulateSystem.simulating_or_running_on_linux?
|
||||
odisabled "`MacOS::Xcode.version` on Linux" if Homebrew::SimulateSystem.simulating_or_running_on_linux?
|
||||
# may return a version string
|
||||
# that is guessed based on the compiler, so do not
|
||||
# use it in order to check if Xcode is installed.
|
||||
@ -274,7 +274,7 @@ module OS
|
||||
# Returns true even if outdated tools are installed.
|
||||
sig { returns(T::Boolean) }
|
||||
def self.installed?
|
||||
odeprecated "`MacOS::CLT.installed?` on Linux" if Homebrew::SimulateSystem.simulating_or_running_on_linux?
|
||||
odisabled "`MacOS::CLT.installed?` on Linux" if Homebrew::SimulateSystem.simulating_or_running_on_linux?
|
||||
!version.null?
|
||||
end
|
||||
|
||||
@ -409,7 +409,7 @@ module OS
|
||||
# @api internal
|
||||
sig { returns(::Version) }
|
||||
def self.version
|
||||
odeprecated "`MacOS::CLT.version` on Linux" if Homebrew::SimulateSystem.simulating_or_running_on_linux?
|
||||
odisabled "`MacOS::CLT.version` on Linux" if Homebrew::SimulateSystem.simulating_or_running_on_linux?
|
||||
if @version ||= detect_version
|
||||
::Version.new @version
|
||||
else
|
||||
|
@ -143,7 +143,7 @@ class SoftwareSpec
|
||||
end
|
||||
|
||||
def go_resource(name, &block)
|
||||
# odeprecated "`SoftwareSpec#go_resource`", "Go modules"
|
||||
odeprecated "`SoftwareSpec#go_resource`", "Go modules"
|
||||
resource name, Resource::Go, &block
|
||||
end
|
||||
|
||||
|
@ -1,12 +0,0 @@
|
||||
# typed: true
|
||||
|
||||
# DO NOT EDIT MANUALLY
|
||||
# This is an autogenerated file for dynamic methods in `Homebrew::Cmd::PostgresqlUpgradeDatabase`.
|
||||
# Please instead update this file by running `bin/tapioca dsl Homebrew::Cmd::PostgresqlUpgradeDatabase`.
|
||||
|
||||
class Homebrew::Cmd::PostgresqlUpgradeDatabase
|
||||
sig { returns(Homebrew::Cmd::PostgresqlUpgradeDatabase::Args) }
|
||||
def args; end
|
||||
end
|
||||
|
||||
class Homebrew::Cmd::PostgresqlUpgradeDatabase::Args < Homebrew::CLI::Args; end
|
@ -58,12 +58,6 @@ class Homebrew::DevCmd::Audit::Args < Homebrew::CLI::Args
|
||||
sig { returns(T::Boolean) }
|
||||
def new?; end
|
||||
|
||||
sig { returns(T::Boolean) }
|
||||
def new_cask?; end
|
||||
|
||||
sig { returns(T::Boolean) }
|
||||
def new_formula?; end
|
||||
|
||||
sig { returns(T::Boolean) }
|
||||
def online?; end
|
||||
|
||||
|
@ -16,12 +16,6 @@ class Homebrew::DevCmd::Bump::Args < Homebrew::CLI::Args
|
||||
sig { returns(T::Boolean) }
|
||||
def casks?; end
|
||||
|
||||
sig { returns(T::Boolean) }
|
||||
def f?; end
|
||||
|
||||
sig { returns(T::Boolean) }
|
||||
def force?; end
|
||||
|
||||
sig { returns(T::Boolean) }
|
||||
def formula?; end
|
||||
|
||||
|
@ -16,12 +16,6 @@ class Homebrew::DevCmd::BumpCaskPr::Args < Homebrew::CLI::Args
|
||||
sig { returns(T::Boolean) }
|
||||
def dry_run?; end
|
||||
|
||||
sig { returns(T::Boolean) }
|
||||
def f?; end
|
||||
|
||||
sig { returns(T::Boolean) }
|
||||
def force?; end
|
||||
|
||||
sig { returns(T.nilable(String)) }
|
||||
def fork_org; end
|
||||
|
||||
|
@ -118,20 +118,6 @@ class Tap
|
||||
[tap, token.downcase]
|
||||
end
|
||||
|
||||
sig { returns(CoreCaskTap) }
|
||||
def self.default_cask_tap
|
||||
odisabled "`Tap.default_cask_tap`", "`CoreCaskTap.instance`"
|
||||
|
||||
CoreCaskTap.instance
|
||||
end
|
||||
|
||||
sig { params(force: T::Boolean).returns(T::Boolean) }
|
||||
def self.install_default_cask_tap_if_necessary(force: false)
|
||||
odisabled "`Tap.install_default_cask_tap_if_necessary`", "`CoreCaskTap.instance.ensure_installed!`"
|
||||
|
||||
false
|
||||
end
|
||||
|
||||
sig { returns(T::Set[Tap]) }
|
||||
def self.allowed_taps
|
||||
cache_key = :"allowed_taps_#{Homebrew::EnvConfig.allowed_taps.to_s.tr(" ", "_")}"
|
||||
@ -1042,7 +1028,7 @@ class Tap
|
||||
# An array of all installed {Tap} names.
|
||||
sig { returns(T::Array[String]) }
|
||||
def self.names
|
||||
# odeprecated "`#{self}.names`"
|
||||
odeprecated "`#{self}.names`"
|
||||
|
||||
map(&:name).sort
|
||||
end
|
||||
@ -1154,7 +1140,7 @@ class AbstractCoreTap < Tap
|
||||
|
||||
sig { void }
|
||||
def self.ensure_installed!
|
||||
# odeprecated "`#{self}.ensure_installed!`", "`#{self}.instance.ensure_installed!`"
|
||||
odeprecated "`#{self}.ensure_installed!`", "`#{self}.instance.ensure_installed!`"
|
||||
|
||||
instance.ensure_installed!
|
||||
end
|
||||
|
@ -31,30 +31,9 @@ RSpec.describe Caveats do
|
||||
end
|
||||
|
||||
describe "#caveats" do
|
||||
context "when f.plist is not nil", :needs_macos do
|
||||
context "when service block is defined" do
|
||||
before do
|
||||
allow(Utils::Service).to receive(:launchctl?).and_return(true)
|
||||
end
|
||||
|
||||
it "prints error when no launchd is present" do
|
||||
f = formula do
|
||||
url "foo-1.0"
|
||||
def plist
|
||||
"plist_test.plist"
|
||||
end
|
||||
end
|
||||
expect(Utils::Service).to receive(:launchctl?).once.and_return(false)
|
||||
expect(described_class.new(f).caveats).to include("provides a launchd plist which can only be used on macOS!")
|
||||
end
|
||||
|
||||
it "prints plist login information when f.plist_startup is nil" do
|
||||
f = formula do
|
||||
url "foo-1.0"
|
||||
def plist
|
||||
"plist_test.plist"
|
||||
end
|
||||
end
|
||||
expect(described_class.new(f).caveats).to include("restart at login")
|
||||
allow(Utils::Service).to receive_messages(launchctl?: true, systemctl?: true)
|
||||
end
|
||||
|
||||
it "gives information about service" do
|
||||
@ -71,41 +50,6 @@ RSpec.describe Caveats do
|
||||
expect(caveats).to include("background service")
|
||||
end
|
||||
|
||||
it "warns about brew failing under tmux" do
|
||||
f = formula do
|
||||
url "foo-1.0"
|
||||
def plist
|
||||
"plist_test.plist"
|
||||
end
|
||||
end
|
||||
ENV["HOMEBREW_TMUX"] = "1"
|
||||
allow(Homebrew).to receive(:_system).and_return(true)
|
||||
allow(Homebrew).to receive(:_system).with("/usr/bin/pbpaste").and_return(false)
|
||||
caveats = described_class.new(f).caveats
|
||||
|
||||
expect(caveats).to include("WARNING:")
|
||||
expect(caveats).to include("tmux")
|
||||
end
|
||||
|
||||
# TODO: This should get deprecated and the service block `plist_name` method should get used instead.
|
||||
it "prints info when there are custom service files" do
|
||||
f = formula do
|
||||
url "foo-1.0"
|
||||
def plist_name
|
||||
"custom.mxcl.foo"
|
||||
end
|
||||
end
|
||||
expect(Utils::Service).to receive(:installed?).with(f).once.and_return(true)
|
||||
expect(Utils::Service).to receive(:running?).with(f).once.and_return(false)
|
||||
expect(described_class.new(f).caveats).to include("restart at login")
|
||||
end
|
||||
end
|
||||
|
||||
context "when service block is defined" do
|
||||
before do
|
||||
allow(Utils::Service).to receive_messages(launchctl?: true, systemctl?: true)
|
||||
end
|
||||
|
||||
it "prints warning when no service daemon is found" do
|
||||
f = formula do
|
||||
url "foo-1.0"
|
||||
@ -113,8 +57,8 @@ RSpec.describe Caveats do
|
||||
run [bin/"cmd"]
|
||||
end
|
||||
end
|
||||
expect(Utils::Service).to receive(:launchctl?).twice.and_return(false)
|
||||
expect(Utils::Service).to receive(:systemctl?).once.and_return(false)
|
||||
expect(Utils::Service).to receive(:launchctl?).and_return(false)
|
||||
expect(Utils::Service).to receive(:systemctl?).and_return(false)
|
||||
expect(described_class.new(f).caveats).to include("service which can only be used on macOS or systemd!")
|
||||
end
|
||||
|
||||
|
@ -1,8 +0,0 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
require "cmd/postgresql-upgrade-database"
|
||||
require "cmd/shared_examples/args_parse"
|
||||
|
||||
RSpec.describe Homebrew::Cmd::PostgresqlUpgradeDatabase do
|
||||
it_behaves_like "parseable arguments"
|
||||
end
|
@ -451,22 +451,6 @@ RSpec.describe FormulaInstaller do
|
||||
end
|
||||
|
||||
describe "#install_service" do
|
||||
it "works if plist is set" do
|
||||
formula = Testball.new
|
||||
path = formula.launchd_service_path
|
||||
formula.opt_prefix.mkpath
|
||||
|
||||
expect(formula).to receive(:plist).twice.and_return("PLIST")
|
||||
expect(formula).to receive(:launchd_service_path).and_call_original
|
||||
|
||||
installer = described_class.new(formula)
|
||||
expect do
|
||||
installer.install_service
|
||||
end.not_to output(/Error: Failed to install service files/).to_stderr
|
||||
|
||||
expect(path).to exist
|
||||
end
|
||||
|
||||
it "works if service is set" do
|
||||
formula = Testball.new
|
||||
service = Homebrew::Service.new(formula)
|
||||
@ -474,14 +458,13 @@ RSpec.describe FormulaInstaller do
|
||||
service_path = formula.systemd_service_path
|
||||
formula.opt_prefix.mkpath
|
||||
|
||||
expect(formula).to receive(:plist).and_return(nil)
|
||||
expect(formula).to receive(:service?).exactly(3).and_return(true)
|
||||
expect(formula).to receive(:service).exactly(7).and_return(service)
|
||||
expect(formula).to receive(:service?).and_return(true)
|
||||
expect(formula).to receive(:service).at_least(:once).and_return(service)
|
||||
expect(formula).to receive(:launchd_service_path).and_call_original
|
||||
expect(formula).to receive(:systemd_service_path).and_call_original
|
||||
|
||||
expect(service).to receive(:timed?).and_return(false)
|
||||
expect(service).to receive(:command?).exactly(2).and_return(true)
|
||||
expect(service).to receive(:command?).and_return(true)
|
||||
expect(service).to receive(:to_plist).and_return("plist")
|
||||
expect(service).to receive(:to_systemd_unit).and_return("unit")
|
||||
|
||||
@ -502,15 +485,14 @@ RSpec.describe FormulaInstaller do
|
||||
timer_path = formula.systemd_timer_path
|
||||
formula.opt_prefix.mkpath
|
||||
|
||||
expect(formula).to receive(:plist).and_return(nil)
|
||||
expect(formula).to receive(:service?).exactly(3).and_return(true)
|
||||
expect(formula).to receive(:service).exactly(9).and_return(service)
|
||||
expect(formula).to receive(:service?).and_return(true)
|
||||
expect(formula).to receive(:service).at_least(:once).and_return(service)
|
||||
expect(formula).to receive(:launchd_service_path).and_call_original
|
||||
expect(formula).to receive(:systemd_service_path).and_call_original
|
||||
expect(formula).to receive(:systemd_timer_path).and_call_original
|
||||
|
||||
expect(service).to receive(:timed?).and_return(true)
|
||||
expect(service).to receive(:command?).exactly(2).and_return(true)
|
||||
expect(service).to receive(:command?).and_return(true)
|
||||
expect(service).to receive(:to_plist).and_return("plist")
|
||||
expect(service).to receive(:to_systemd_unit).and_return("unit")
|
||||
expect(service).to receive(:to_systemd_timer).and_return("timer")
|
||||
@ -530,8 +512,7 @@ RSpec.describe FormulaInstaller do
|
||||
path = formula.launchd_service_path
|
||||
formula.opt_prefix.mkpath
|
||||
|
||||
expect(formula).to receive(:plist).and_return(nil)
|
||||
expect(formula).to receive(:service?).exactly(3).and_return(nil)
|
||||
expect(formula).to receive(:service?).and_return(nil)
|
||||
expect(formula).not_to receive(:launchd_service_path)
|
||||
|
||||
installer = described_class.new(formula)
|
||||
@ -541,24 +522,5 @@ RSpec.describe FormulaInstaller do
|
||||
|
||||
expect(path).not_to exist
|
||||
end
|
||||
|
||||
it "errors with duplicate definition" do
|
||||
formula = Testball.new
|
||||
path = formula.launchd_service_path
|
||||
formula.opt_prefix.mkpath
|
||||
|
||||
expect(formula).to receive(:plist).and_return("plist")
|
||||
expect(formula).to receive(:service?).and_return(true)
|
||||
expect(formula).not_to receive(:service)
|
||||
expect(formula).not_to receive(:launchd_service_path)
|
||||
|
||||
installer = described_class.new(formula)
|
||||
expect do
|
||||
installer.install_service
|
||||
end.to output("Error: Formula specified both service and plist\n").to_stderr
|
||||
|
||||
expect(Homebrew).to have_failed
|
||||
expect(path).not_to exist
|
||||
end
|
||||
end
|
||||
end
|
||||
|
@ -1,15 +0,0 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
require "language/go"
|
||||
|
||||
RSpec.describe Language::Go do
|
||||
specify "#stage_deps" do
|
||||
ENV.delete("HOMEBREW_DEVELOPER")
|
||||
|
||||
expect(described_class).to receive(:opoo).once
|
||||
|
||||
mktmpdir do |path|
|
||||
described_class.stage_deps [], path
|
||||
end
|
||||
end
|
||||
end
|
@ -92,19 +92,6 @@ RSpec.describe Homebrew::Livecheck::SkipConditions do
|
||||
regex(/"stable":"(\d+(?:\.\d+)+)"/i)
|
||||
end
|
||||
end,
|
||||
discontinued: Cask::Cask.new("test_discontinued") do
|
||||
version "0.0.1"
|
||||
sha256 :no_check
|
||||
|
||||
url "https://brew.sh/test-0.0.1.tgz"
|
||||
name "Test Discontinued"
|
||||
desc "Discontinued test cask"
|
||||
homepage "https://brew.sh"
|
||||
|
||||
caveats do
|
||||
discontinued
|
||||
end
|
||||
end,
|
||||
deprecated: Cask::Cask.new("test_deprecated") do
|
||||
version "0.0.1"
|
||||
sha256 :no_check
|
||||
@ -258,13 +245,6 @@ RSpec.describe Homebrew::Livecheck::SkipConditions do
|
||||
},
|
||||
},
|
||||
cask: {
|
||||
discontinued: {
|
||||
cask: "test_discontinued",
|
||||
status: "discontinued",
|
||||
meta: {
|
||||
livecheckable: false,
|
||||
},
|
||||
},
|
||||
deprecated: {
|
||||
cask: "test_deprecated",
|
||||
status: "deprecated",
|
||||
@ -380,13 +360,6 @@ RSpec.describe Homebrew::Livecheck::SkipConditions do
|
||||
end
|
||||
end
|
||||
|
||||
context "when a cask without a livecheckable is discontinued" do
|
||||
it "skips" do
|
||||
expect(skip_conditions.skip_information(casks[:discontinued]))
|
||||
.to eq(status_hashes[:cask][:discontinued])
|
||||
end
|
||||
end
|
||||
|
||||
context "when a cask without a livecheckable is deprecated" do
|
||||
it "skips" do
|
||||
expect(skip_conditions.skip_information(casks[:deprecated]))
|
||||
@ -503,13 +476,6 @@ RSpec.describe Homebrew::Livecheck::SkipConditions do
|
||||
end
|
||||
end
|
||||
|
||||
context "when a cask without a livecheckable is discontinued" do
|
||||
it "errors" do
|
||||
expect { skip_conditions.referenced_skip_information(casks[:discontinued], original_name) }
|
||||
.to raise_error(RuntimeError, "Referenced cask (test_discontinued) is skipped as discontinued")
|
||||
end
|
||||
end
|
||||
|
||||
context "when a cask without a livecheckable is deprecated" do
|
||||
it "errors" do
|
||||
expect { skip_conditions.referenced_skip_information(casks[:deprecated], original_name) }
|
||||
@ -635,14 +601,6 @@ RSpec.describe Homebrew::Livecheck::SkipConditions do
|
||||
end
|
||||
end
|
||||
|
||||
context "when the cask is discontinued without a livecheckable" do
|
||||
it "prints skip information" do
|
||||
expect { skip_conditions.print_skip_information(status_hashes[:cask][:discontinued]) }
|
||||
.to output("test_discontinued: discontinued\n").to_stdout
|
||||
.and not_to_output.to_stderr
|
||||
end
|
||||
end
|
||||
|
||||
context "when the cask is deprecated without a livecheckable" do
|
||||
it "prints skip information" do
|
||||
expect { skip_conditions.print_skip_information(status_hashes[:cask][:deprecated]) }
|
||||
|
@ -20,7 +20,7 @@ RSpec.describe Migrator do
|
||||
let(:old_pin) { HOMEBREW_PINNED_KEGS/"oldname" }
|
||||
|
||||
before do |example|
|
||||
allow(new_formula).to receive(:oldname).and_return("oldname")
|
||||
allow(new_formula).to receive(:oldnames).and_return(["oldname"])
|
||||
|
||||
# do not create directories for error tests
|
||||
next if example.metadata[:description].start_with?("raises an error")
|
||||
|
@ -1,11 +0,0 @@
|
||||
cask "invalid-appcast-multiple" do
|
||||
version "1.2.3"
|
||||
sha256 "67cdb8a02803ef37fdbf7e0be205863172e41a561ca446cd84f0d7ab35a99d94"
|
||||
|
||||
url "file://#{TEST_FIXTURE_DIR}/cask/caffeine.zip"
|
||||
appcast "https://brew.sh/appcast1.xml"
|
||||
appcast "https://brew.sh/appcast2.xml"
|
||||
homepage "https://brew.sh/invalid-appcast-multiple"
|
||||
|
||||
app "Caffeine.app"
|
||||
end
|
@ -1,10 +0,0 @@
|
||||
cask "invalid-appcast-url" do
|
||||
version "1.2.3"
|
||||
sha256 "67cdb8a02803ef37fdbf7e0be205863172e41a561ca446cd84f0d7ab35a99d94"
|
||||
|
||||
url "file://#{TEST_FIXTURE_DIR}/cask/caffeine.zip"
|
||||
appcast 1
|
||||
homepage "https://brew.sh/invalid-appcast-url"
|
||||
|
||||
app "Caffeine.app"
|
||||
end
|
@ -1,10 +0,0 @@
|
||||
cask "with-appcast" do
|
||||
version "1.2.3"
|
||||
sha256 "67cdb8a02803ef37fdbf7e0be205863172e41a561ca446cd84f0d7ab35a99d94"
|
||||
|
||||
url "file://#{TEST_FIXTURE_DIR}/cask/caffeine.zip"
|
||||
appcast "https://brew.sh/appcast.xml"
|
||||
homepage "https://brew.sh/with-appcast"
|
||||
|
||||
app "Caffeine.app"
|
||||
end
|
@ -8,7 +8,6 @@
|
||||
"desc": null,
|
||||
"homepage": "https://brew.sh/",
|
||||
"url": "https://www.example.com/cask/caffeine.zip",
|
||||
"appcast": null,
|
||||
"version": "1.2.3",
|
||||
"installed": null,
|
||||
"outdated": false,
|
||||
|
@ -17,7 +17,6 @@
|
||||
},
|
||||
"user_agent": ":fake"
|
||||
},
|
||||
"appcast": null,
|
||||
"version": "1.2.3",
|
||||
"installed": null,
|
||||
"installed_time": null,
|
||||
|
@ -160,10 +160,6 @@ RSpec.describe Tap do
|
||||
end
|
||||
end
|
||||
|
||||
specify "::names" do
|
||||
expect(described_class.names.sort).to eq(["homebrew/core", "homebrew/foo"])
|
||||
end
|
||||
|
||||
specify "attributes" do
|
||||
expect(homebrew_foo_tap.user).to eq("Homebrew")
|
||||
expect(homebrew_foo_tap.repo).to eq("foo")
|
||||
|
@ -345,12 +345,6 @@ class Version
|
||||
parse(specs.fetch(:tag, url), detected_from_url: true)
|
||||
end
|
||||
|
||||
sig { params(val: String).returns(Version) }
|
||||
def self.create(val)
|
||||
odisabled "`Version.create`", "`Version.new`"
|
||||
new(val)
|
||||
end
|
||||
|
||||
sig { params(spec: T.any(String, Pathname), detected_from_url: T::Boolean).returns(T.attached_class) }
|
||||
def self.parse(spec, detected_from_url: false)
|
||||
spec = CGI.unescape(spec.to_s) if detected_from_url
|
||||
|
Loading…
x
Reference in New Issue
Block a user