Merge pull request #3896 from MikeMcQuaid/more-deprecate-disable-delete

Disable/delete more deprecations
This commit is contained in:
Mike McQuaid 2018-04-08 23:16:10 +01:00 committed by GitHub
commit cd84f440b4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
46 changed files with 76 additions and 975 deletions

View File

@ -1,67 +0,0 @@
#: @hide_from_man_page
#: * `linkapps` [`--local`] [<formulae>]:
#: Find installed formulae that provide `.app`-style macOS apps and symlink them
#: into `/Applications`, allowing for easier access (deprecated).
#:
#: Unfortunately `brew linkapps` cannot behave nicely with e.g. Spotlight using
#: either aliases or symlinks and Homebrew formulae do not build "proper" `.app`
#: bundles that can be relocated. Instead, please consider using `brew cask` and
#: migrate formulae using `.app`s to casks.
require "keg"
require "formula"
module Homebrew
module_function
def linkapps
odeprecated "'brew linkapps'"
target_dir = linkapps_target(local: ARGV.include?("--local"))
unless target_dir.directory?
opoo "#{target_dir} does not exist, stopping."
puts "Run `mkdir #{target_dir}` first."
exit 1
end
if ARGV.named.empty?
kegs = Formula.racks.map do |rack|
keg = rack.subdirs.map { |d| Keg.new(d) }
next if keg.empty?
keg.detect(&:linked?) || keg.max_by(&:version)
end
else
kegs = ARGV.kegs
end
link_count = 0
kegs.each do |keg|
keg.apps.each do |app|
puts "Linking: #{app}"
target_app = target_dir/app.basename
if target_app.exist? && !target_app.symlink?
onoe "#{target_app} already exists, skipping."
next
end
# We prefer system `ln` over `FileUtils.ln_sf` because the latter seems
# to have weird failure conditions (that were observed in the past).
system "ln", "-sf", app, target_dir
link_count += 1
end
end
if link_count.zero?
puts "No apps linked to #{target_dir}" if ARGV.verbose?
else
puts "Linked #{Formatter.pluralize(link_count, "app")} to #{target_dir}"
end
end
def linkapps_target(opts = {})
local = opts.fetch(:local, false)
Pathname.new(local ? "~/Applications" : "/Applications").expand_path
end
end

View File

@ -1,15 +1,12 @@
#: * `prune` [`--dry-run`]:
#: Remove dead symlinks from the Homebrew prefix. This is generally not
#: needed, but can be useful when doing DIY installations. Also remove broken
#: app symlinks from `/Applications` and `~/Applications` that were previously
#: created by `brew linkapps`.
#: needed, but can be useful when doing DIY installations.
#:
#: If `--dry-run` or `-n` is passed, show what would be removed, but do not
#: actually remove anything.
require "keg"
require "cmd/tap"
require "cmd/unlinkapps"
module Homebrew
module_function
@ -49,17 +46,15 @@ module Homebrew
end
end
unless ARGV.dry_run?
if ObserverPathnameExtension.total.zero?
puts "Nothing pruned" if ARGV.verbose?
else
n, d = ObserverPathnameExtension.counts
print "Pruned #{n} symbolic links "
print "and #{d} directories " if d.positive?
puts "from #{HOMEBREW_PREFIX}"
end
end
return if ARGV.dry_run?
unlinkapps_prune(dry_run: ARGV.dry_run?, quiet: true)
if ObserverPathnameExtension.total.zero?
puts "Nothing pruned" if ARGV.verbose?
else
n, d = ObserverPathnameExtension.counts
print "Pruned #{n} symbolic links "
print "and #{d} directories " if d.positive?
puts "from #{HOMEBREW_PREFIX}"
end
end
end

View File

@ -1,79 +0,0 @@
#: @hide_from_man_page
#: * `unlinkapps` [`--local`] [`--dry-run`] [<formulae>]:
#: Remove symlinks created by `brew linkapps` from `/Applications` (deprecated).
#:
#: Unfortunately `brew linkapps` cannot behave nicely with e.g. Spotlight using
#: either aliases or symlinks and Homebrew formulae do not build "proper" `.app`
#: bundles that can be relocated. Instead, please consider using `brew cask` and
#: migrate formulae using `.app`s to casks.
require "cmd/linkapps"
module Homebrew
module_function
def unlinkapps
odeprecated "'brew unlinkapps'"
target_dir = linkapps_target(local: ARGV.include?("--local"))
unlinkapps_from_dir(target_dir, dry_run: ARGV.dry_run?)
end
def unlinkapps_prune(opts = {})
opts = opts.merge(prune: true)
unlinkapps_from_dir(linkapps_target(local: false), opts)
unlinkapps_from_dir(linkapps_target(local: true), opts)
end
def unlinkapps_from_dir(target_dir, opts = {})
return unless target_dir.directory?
dry_run = opts.fetch(:dry_run, false)
quiet = opts.fetch(:quiet, false)
apps = Pathname.glob("#{target_dir}/*.app").select do |app|
unlinkapps_unlink?(app, opts)
end
ObserverPathnameExtension.reset_counts!
app_kind = opts.fetch(:prune, false) ? " (broken link)" : ""
apps.each do |app|
app.extend(ObserverPathnameExtension)
if dry_run
puts "Would unlink#{app_kind}: #{app}"
else
puts "Unlinking#{app_kind}: #{app}" unless quiet
app.unlink
end
end
return if dry_run
if ObserverPathnameExtension.total.zero?
puts "No apps unlinked from #{target_dir}" if ARGV.verbose?
else
n = ObserverPathnameExtension.total
puts "Unlinked #{Formatter.pluralize(n, "app")} from #{target_dir}"
end
end
UNLINKAPPS_PREFIXES = %W[
#{HOMEBREW_CELLAR}/
#{HOMEBREW_PREFIX}/opt/
].freeze
def unlinkapps_unlink?(target_app, opts = {})
# Skip non-symlinks and symlinks that don't point into the Homebrew prefix.
app = target_app.readlink.to_s if target_app.symlink?
return false unless app&.start_with?(*UNLINKAPPS_PREFIXES)
if opts.fetch(:prune, false)
!File.exist?(app) # Remove only broken symlinks in prune mode.
elsif ARGV.named.empty?
true
else
ARGV.kegs.any? { |keg| app.start_with?("#{keg}/", "#{keg.opt_record}/") }
end
end
end

View File

@ -29,7 +29,7 @@ module Homebrew
Homebrew.perform_preinstall_checks
odeprecated "'brew upgrade --all'", "'brew upgrade'" if ARGV.include?("--all")
odisabled "'brew upgrade --all'", "'brew upgrade'" if ARGV.include?("--all")
if ARGV.named.empty?
outdated = Formula.installed.select do |f|

View File

@ -54,48 +54,19 @@ module Homebrew
used_formulae.all? do |ff|
begin
deps = f.runtime_dependencies if only_installed_arg
if recursive
deps ||= recursive_includes(Dependency, f, includes, ignores)
dep_formulae = deps.flat_map do |dep|
begin
dep.to_formula
rescue
[]
end
end
reqs_by_formula = ([f] + dep_formulae).flat_map do |formula|
formula.requirements.map { |req| [formula, req] }
end
reqs_by_formula.reject! do |dependent, req|
if req.recommended?
ignores.include?("recommended?") || dependent.build.without?(req)
elsif req.test?
!includes.include?("test?")
elsif req.optional?
!includes.include?("optional?") && !dependent.build.with?(req)
elsif req.build?
!includes.include?("build?")
end
end
reqs = reqs_by_formula.map(&:last)
deps ||= if recursive
recursive_includes(Dependency, f, includes, ignores)
else
deps ||= reject_ignores(f.deps, ignores, includes)
reqs = reject_ignores(f.requirements, ignores, includes)
reject_ignores(f.deps, ignores, includes)
end
next true if deps.any? do |dep|
deps.any? do |dep|
begin
dep.to_formula.full_name == ff.full_name
rescue
dep.name == ff.name
end
end
reqs.any? { |req| req.name == ff.name }
rescue FormulaUnavailableError
# Silently ignore this case as we don't care about things used in
# taps that aren't currently tapped.

View File

@ -1,32 +1,10 @@
require "compat/fails_with_llvm"
require "compat/tap"
require "compat/hbc"
require "compat/formula"
require "compat/formula_specialties"
require "compat/formula_support"
require "compat/global"
require "compat/hardware"
require "compat/macos"
require "compat/md5"
require "compat/sha1"
require "compat/requirements"
require "compat/version"
require "compat/download_strategy"
require "compat/keg"
require "compat/pathname"
require "compat/dependency_collector"
require "compat/language/haskell"
require "compat/xcode"
require "compat/software_spec"
require "compat/utils"
require "compat/json"
require "compat/ARGV"
require "compat/build_options"
require "compat/tab"
require "compat/ENV/shared"
require "compat/ENV/std"
require "compat/ENV/super"
require "compat/utils/shell"
require "compat/extend/string"
require "compat/gpg"
require "compat/dependable"

View File

@ -1,5 +0,0 @@
module HomebrewArgvExtension
def build_32_bit?
odisabled "ARGV.build_32_bit?"
end
end

View File

@ -1,10 +1,9 @@
module SharedEnvExtension
def j1
odeprecated "ENV.j1", "ENV.deparallelize"
deparallelize
odisabled "ENV.j1", "ENV.deparallelize"
end
def java_cache
odeprecated "ENV.java_cache"
odisabled "ENV.java_cache"
end
end

View File

@ -1,25 +0,0 @@
module Stdenv
def fast
odisabled "ENV.fast"
end
def O4
odisabled "ENV.O4"
end
def Og
odisabled "ENV.Og"
end
def gcc_4_0_1
odisabled "ENV.gcc_4_0_1", "ENV.gcc_4_0"
end
def gcc
odisabled "ENV.gcc", "ENV.gcc_4_2"
end
def libpng
odisabled "ENV.libpng", "ENV.x11"
end
end

View File

@ -1,45 +0,0 @@
module Superenv
def fast
odisabled "ENV.fast"
end
def O4
odisabled "ENV.O4"
end
def Og
odisabled "ENV.Og"
end
def gcc_4_0_1
odisabled "ENV.gcc_4_0_1", "ENV.gcc_4_0"
end
def gcc
odisabled "ENV.gcc", "ENV.gcc_4_2"
end
def libxml2
odisabled "ENV.libxml2"
end
def minimal_optimization
odisabled "ENV.minimal_optimization"
end
def no_optimization
odisabled "ENV.no_optimization"
end
def enable_warnings
odisabled "ENV.enable_warnings"
end
def macosxsdk
odisabled "ENV.macosxsdk"
end
def remove_macosxsdk
odisabled "ENV.remove_macosxsdk"
end
end

View File

@ -1,9 +0,0 @@
class BuildOptions
def build_32_bit?
odisabled "build.build_32_bit?"
end
def build_bottle?
odisabled "build.build_bottle?", "build.bottle?"
end
end

View File

@ -1,5 +1,6 @@
module Dependable
def run?
odeprecated "Dependable#run?"
tags.include? :run
end
end

View File

@ -9,56 +9,42 @@ class DependencyCollector
def parse_string_spec(spec, tags)
if (tag = tags.first) && LANGUAGE_MODULES.include?(tag)
odeprecated "'depends_on ... => #{tag.inspect}'"
LanguageModuleRequirement.new(tag, spec, tags[1])
else
super
odisabled "'depends_on ... => #{tag.inspect}'"
end
if tags.include?(:run)
odeprecated "'depends_on ... => :run'"
end
super
end
def parse_symbol_spec(spec, tags)
case spec
when :clt
odeprecated "'depends_on :clt'"
odisabled "'depends_on :clt'"
when :tex
odeprecated "'depends_on :tex'"
TeXRequirement.new(tags)
when :autoconf, :automake, :bsdmake, :libtool
output_deprecation(spec)
autotools_dep(spec, tags)
when :cairo, :fontconfig, :freetype, :libpng, :pixman
output_deprecation(spec)
Dependency.new(spec.to_s, tags)
when :ant, :expat
output_deprecation(spec)
Dependency.new(spec.to_s, tags)
odisabled "'depends_on :tex'"
when :libltdl
output_deprecation("libtool")
Dependency.new("libtool", tags)
output_disabled(spec, "libtool")
when :apr
output_deprecation(spec, "apr-util")
Dependency.new("apr-util", tags)
output_disabled(spec, "apr-util")
when :fortran
output_deprecation(spec, "gcc")
Dependency.new("gcc", tags)
output_disabled(spec, "gcc")
when :gpg
output_deprecation(spec, "gnupg")
Dependency.new("gnupg", tags)
output_disabled(spec, "gnupg")
when :hg
output_deprecation(spec, "mercurial")
Dependency.new("mercurial", tags)
output_disabled(spec, "mercurial")
when :mpi
output_deprecation(spec, "open-mpi")
Dependency.new("open-mpi", tags)
output_disabled(spec, "open-mpi")
when :python, :python2
output_deprecation(spec, "python@2")
Dependency.new("python@2", tags)
output_disabled(spec, "python@2")
when :python3
output_deprecation(spec, "python")
Dependency.new("python", tags)
when :emacs, :mysql, :perl, :postgresql, :rbenv, :ruby
output_deprecation(spec)
Dependency.new(spec.to_s, tags)
output_disabled(spec, "python")
when :ant, :autoconf, :automake, :bsdmake, :cairo, :emacs, :expat,
:fontconfig, :freetype, :libtool, :libpng, :mysql, :perl, :pixman,
:postgresql, :rbenv, :ruby
output_disabled(spec)
else
super
end
@ -66,14 +52,9 @@ class DependencyCollector
private
def autotools_dep(spec, tags)
tags << :build
Dependency.new(spec.to_s, tags)
end
def output_deprecation(dependency, new_dependency = dependency)
odeprecated "'depends_on :#{dependency}'",
"'depends_on \"#{new_dependency}\"'"
def output_disabled(dependency, new_dependency = dependency)
odisabled "'depends_on :#{dependency}'",
"'depends_on \"#{new_dependency}\"'"
end
end

View File

@ -1,7 +1,6 @@
class String
def undent
odeprecated "<<-EOS.undent", "<<~EOS"
gsub(/^[ \t]{#{(slice(/^[ \t]+/) || '').length}}/, "")
odisabled "<<-EOS.undent", "<<~EOS"
end
alias unindent undent

View File

@ -1,9 +0,0 @@
class Formula
def fails_with_llvm(_msg = nil, _data = nil)
odisabled "Formula#fails_with_llvm in install"
end
def self.fails_with_llvm(_msg = nil, _data = {})
odisabled "Formula.fails_with_llvm"
end
end

View File

@ -1,74 +1,11 @@
module FormulaCompat
def x11_installed?
odisabled "Formula#x11_installed?", "MacOS::X11.installed?"
end
def snow_leopard_64?
odisabled "Formula#snow_leopard_64?", "MacOS.prefer_64_bit?"
end
end
class Formula
include FormulaCompat
extend FormulaCompat
def std_cmake_parameters
odisabled "Formula#std_cmake_parameters", "Formula#std_cmake_args"
end
def cxxstdlib_check(_)
odisabled "Formula#cxxstdlib_check in install",
"Formula.cxxstdlib_check outside install"
end
def self.bottle_sha1(*)
odisabled "Formula.bottle_sha1"
end
def self.all
odisabled "Formula.all", "Formula.map"
end
def self.canonical_name(_)
odisabled "Formula.canonical_name", "Formulary.canonical_name"
end
def self.class_s(_)
odisabled "Formula.class_s", "Formulary.class_s"
end
def self.factory(_)
odisabled "Formula.factory", "Formulary.factory"
end
def self.require_universal_deps
odisabled "Formula.require_universal_deps"
end
def self.path(_)
odisabled "Formula.path", "Formulary.core_path"
end
DATA = :DATA
def patches
# Don't print deprecation warning because this method is inherited
# when used.
{}
end
def python(_options = {}, &_)
odisabled "Formula#python"
end
alias python2 python
alias python3 python
def startup_plist
odisabled "Formula#startup_plist", "Formula#plist"
end
def rake(*args)
odeprecated "FileUtils#rake", "system \"rake\""
system "rake", *args
def rake(*)
odisabled "FileUtils#rake", "system \"rake\""
end
end

View File

@ -1,23 +0,0 @@
class ScriptFileFormula < Formula
def install
odisabled "ScriptFileFormula#install", "Formula#install"
end
end
class GithubGistFormula < ScriptFileFormula
def self.url(_val)
odisabled "GithubGistFormula.url", "Formula.url"
end
end
class AmazonWebServicesFormula < Formula
def install
odisabled "AmazonWebServicesFormula#install", "Formula#install"
end
alias standard_install install
# Use this method to generate standard caveats.
def standard_instructions(_, _)
odisabled "AmazonWebServicesFormula#standard_instructions", "Formula#caveats"
end
end

View File

@ -5,11 +5,9 @@ class KegOnlyReason
def to_s
case @reason
when :provided_by_osx
odeprecated "keg_only :provided_by_osx", "keg_only :provided_by_macos"
@reason = :provided_by_macos
odisabled "keg_only :provided_by_osx", "keg_only :provided_by_macos"
when :shadowed_by_osx
odeprecated "keg_only :shadowed_by_osx", "keg_only :shadowed_by_macos"
@reason = :shadowed_by_macos
odisabled "keg_only :shadowed_by_osx", "keg_only :shadowed_by_macos"
end
super

View File

@ -1,15 +0,0 @@
module Homebrew
module_function
def method_missing(method, *args, &block)
if instance_methods.include?(method)
odisabled "#{self}##{method}", "'module_function' or 'def self.#{method}' to convert it to a class method"
end
super
end
def respond_to_missing?(method, include_private = false)
return true if method_defined?(method)
super(method, include_private)
end
end

View File

@ -3,24 +3,22 @@ module Gpg
module_function
def executable
odeprecated "Gpg.executable", 'which "gpg"'
which "gpg"
odisabled "Gpg.executable", 'which "gpg"'
end
def available?
odeprecated "Gpg.available?", 'which "gpg"'
File.executable?(executable.to_s)
odisabled "Gpg.available?", 'which "gpg"'
end
def create_test_key(_)
odeprecated "Gpg.create_test_key"
odisabled "Gpg.create_test_key"
end
def cleanup_test_processes!
odeprecated "Gpg.cleanup_test_processes!"
odisabled "Gpg.cleanup_test_processes!"
end
def test(_)
odeprecated "Gpg.test"
odisabled "Gpg.test"
end
end

View File

@ -1,35 +0,0 @@
module Hardware
class << self
def is_32_bit?
odisabled "Hardware.is_32_bit?", "Hardware::CPU.is_32_bit?"
end
def is_64_bit?
odisabled "Hardware.is_64_bit?", "Hardware::CPU.is_64_bit?"
end
def bits
odisabled "Hardware.bits", "Hardware::CPU.bits"
end
def cpu_type
odisabled "Hardware.cpu_type", "Hardware::CPU.type"
end
def cpu_family
odisabled "Hardware.cpu_family", "Hardware::CPU.family"
end
def intel_family
odisabled "Hardware.intel_family", "Hardware::CPU.family"
end
def ppc_family
odisabled "Hardware.ppc_family", "Hardware::CPU.family"
end
def processor_count
odisabled "Hardware.processor_count", "Hardware::CPU.cores"
end
end
end

View File

@ -1,19 +0,0 @@
require "json"
module Utils
module JSON
module_function
def load(_)
odisabled "Utils::JSON.load", "JSON.parse"
end
def dump(_)
odisabled "Utils::JSON.dump", "JSON.generate"
end
def stringify_keys(_)
odisabled "Utils::JSON.stringify_keys"
end
end
end

View File

@ -1,5 +0,0 @@
class Keg
def fname
odisabled "Keg#fname", "Keg#name"
end
end

View File

@ -1,9 +0,0 @@
module Language
module Haskell
module Cabal
def cabal_clean_lib
odisabled "Language::Haskell::Cabal#cabal_clean_lib"
end
end
end
end

View File

@ -1,124 +0,0 @@
require "development_tools"
if OS.mac?
MACOS_FULL_VERSION = OS::Mac.full_version.to_s.freeze
MACOS_VERSION = OS::Mac.version.to_s.freeze
end
module OS
module Mac
module_function
def xcode_folder
odisabled "MacOS.xcode_folder", "MacOS::Xcode.folder"
end
def xcode_prefix
odisabled "MacOS.xcode_prefix", "MacOS::Xcode.prefix"
end
def xcode_installed?
odisabled "MacOS.xcode_installed?", "MacOS::Xcode.installed?"
end
def xcode_version
odisabled "MacOS.xcode_version", "MacOS::Xcode.version"
end
def clt_installed?
odisabled "MacOS.clt_installed?", "MacOS::CLT.installed?"
end
def clt_version?
odisabled "MacOS.clt_version?", "MacOS::CLT.version"
end
def x11_installed?
odisabled "MacOS.x11_installed?", "MacOS::X11.installed?"
end
def x11_prefix
odisabled "MacOS.x11_prefix", "MacOS::X11.prefix"
end
def leopard?
odisabled "MacOS.leopard?", "'MacOS.version == :leopard'"
end
def snow_leopard?
odisabled "MacOS.snow_leopard?", "'MacOS.version >= :snow_leopard'"
end
def snow_leopard_or_newer?
odisabled "MacOS.snow_leopard_or_newer?", "'MacOS.version >= :snow_leopard'"
end
def lion?
odisabled "MacOS.lion?", "'MacOS.version >= :lion'"
end
def lion_or_newer?
odisabled "MacOS.lion_or_newer?", "'MacOS.version >= :lion'"
end
def mountain_lion?
odisabled "MacOS.mountain_lion?", "'MacOS.version >= :mountain_lion'"
end
def mountain_lion_or_newer?
odisabled "MacOS.mountain_lion_or_newer?", "'MacOS.version >= :mountain_lion'"
end
def macports_or_fink_installed?
odisabled "MacOS.macports_or_fink_installed?", "!MacOS.macports_or_fink.empty?"
end
def locate(_)
odisabled "MacOS.locate", "DevelopmentTools.locate"
end
def default_cc
odisabled "MacOS.default_cc", "DevelopmentTools.default_cc"
end
def default_compiler
odisabled "MacOS.default_compiler", "DevelopmentTools.default_compiler"
end
def gcc_40_build_version
odisabled "MacOS.gcc_40_build_version", "DevelopmentTools.gcc_4_0_build_version"
end
def gcc_4_0_build_version
odisabled "MacOS.gcc_4_0_build_version", "DevelopmentTools.gcc_4_0_build_version"
end
def gcc_42_build_version
odisabled "MacOS.gcc_42_build_version", "DevelopmentTools.gcc_4_2_build_version"
end
def gcc_build_version
odisabled "MacOS.gcc_build_version", "DevelopmentTools.gcc_4_2_build_version"
end
def llvm_build_version
odisabled "MacOS.llvm_build_version"
end
def clang_version
odisabled "MacOS.clang_version", "DevelopmentTools.clang_version"
end
def clang_build_version
odisabled "MacOS.clang_build_version", "DevelopmentTools.clang_build_version"
end
def has_apple_developer_tools?
odisabled "MacOS.has_apple_developer_tools?", "DevelopmentTools.installed?"
end
def release
odisabled "MacOS.release", "MacOS.version"
end
end
end

View File

@ -1,23 +0,0 @@
class Formula
def self.md5(_val)
odisabled "Formula.md5", "Formula.sha256"
end
end
class SoftwareSpec
def md5(_val)
odisabled "SoftwareSpec#md5", "SoftwareSpec#sha256"
end
end
class Resource
def md5(_val)
odisabled "Resource#md5", "Resource#sha256"
end
end
class Pathname
def md5
odisabled "Pathname#md5", "Pathname#sha256"
end
end

View File

@ -1,9 +0,0 @@
class Pathname
def cp(_)
odisabled "Pathname#cp", "FileUtils.cp"
end
def chmod_R(_)
odisabled "Pathname#chmod_R", "FileUtils.chmod_R"
end
end

View File

@ -1,123 +1,107 @@
require "requirements"
require "compat/requirements/language_module_requirement"
class CVSRequirement < Requirement
fatal true
satisfy do
odeprecated("CVSRequirement", "'depends_on \"cvs\"'")
which "cvs"
odisabled("CVSRequirement", "'depends_on \"cvs\"'")
end
end
class EmacsRequirement < Requirement
fatal true
satisfy do
odeprecated("EmacsRequirement", "'depends_on \"emacs\"'")
which "emacs"
odisabled("EmacsRequirement", "'depends_on \"emacs\"'")
end
end
class FortranRequirement < Requirement
fatal true
satisfy do
odeprecated("FortranRequirement", "'depends_on \"gcc\"'")
which "gfortran"
odisabled("FortranRequirement", "'depends_on \"gcc\"'")
end
end
class GitRequirement < Requirement
fatal true
satisfy do
odeprecated("GitRequirement", "'depends_on \"git\"'")
which "git"
odisabled("GitRequirement", "'depends_on \"git\"'")
end
end
class GPG2Requirement < Requirement
fatal true
satisfy do
odeprecated("GPG2Requirement", "'depends_on \"gnupg\"'")
which "gpg"
odisabled("GPG2Requirement", "'depends_on \"gnupg\"'")
end
end
class MercurialRequirement < Requirement
fatal true
satisfy do
odeprecated("MercurialRequirement", "'depends_on \"mercurial\"'")
which "hg"
odisabled("MercurialRequirement", "'depends_on \"mercurial\"'")
end
end
class MPIRequirement < Requirement
fatal true
satisfy do
odeprecated("MPIRequirement", "'depends_on \"open-mpi\"'")
which "mpicc"
odisabled("MPIRequirement", "'depends_on \"open-mpi\"'")
end
end
class MysqlRequirement < Requirement
fatal true
satisfy do
odeprecated("MysqlRequirement", "'depends_on \"mysql\"'")
which "mysql_config"
odisabled("MysqlRequirement", "'depends_on \"mysql\"'")
end
end
class PerlRequirement < Requirement
fatal true
satisfy do
odeprecated("PerlRequirement", "'depends_on \"perl\"'")
which "perl"
odisabled("PerlRequirement", "'depends_on \"perl\"'")
end
end
class PostgresqlRequirement < Requirement
fatal true
satisfy do
odeprecated("PostgresqlRequirement", "'depends_on \"postgresql\"'")
which "pg_config"
odisabled("PostgresqlRequirement", "'depends_on \"postgresql\"'")
end
end
class PythonRequirement < Requirement
fatal true
satisfy do
odeprecated("PythonRequirement", "'depends_on \"python@2\"'")
which "python2"
odisabled("PythonRequirement", "'depends_on \"python@2\"'")
end
end
class Python3Requirement < Requirement
fatal true
satisfy do
odeprecated("Python3Requirement", "'depends_on \"python\"'")
which "python"
odisabled("Python3Requirement", "'depends_on \"python\"'")
end
end
class RbenvRequirement < Requirement
fatal true
satisfy do
odeprecated("RbenvRequirement", "'depends_on \"rbenv\"'")
which "rbenv"
odisabled("RbenvRequirement", "'depends_on \"rbenv\"'")
end
end
class RubyRequirement < Requirement
fatal true
satisfy do
odeprecated("RubyRequirement", "'depends_on \"ruby\"'")
which "ruby"
odisabled("RubyRequirement", "'depends_on \"ruby\"'")
end
end
class SubversionRequirement < Requirement
fatal true
satisfy do
odeprecated("SubversionRequirement", "'depends_on \"subversion\"'")
which "svn"
odisabled("SubversionRequirement", "'depends_on \"subversion\"'")
end
end
@ -126,8 +110,7 @@ class TeXRequirement < Requirement
cask "mactex"
download "https://www.tug.org/mactex/"
satisfy do
odeprecated("TeXRequirement")
which("tex") || which("latex")
odisabled("TeXRequirement")
end
end

View File

@ -1,63 +0,0 @@
require "requirement"
class LanguageModuleRequirement < Requirement
fatal true
def initialize(language, module_name, import_name = nil)
@language = language
@module_name = module_name
@import_name = import_name || module_name
super([language, module_name, import_name])
end
satisfy(build_env: false) { quiet_system(*the_test) }
def message
s = <<~EOS
Unsatisfied dependency: #{@module_name}
Homebrew does not provide special #{@language.to_s.capitalize} dependencies; install with:
`#{command_line} #{@module_name}`
EOS
unless [:python, :perl, :ruby].include? @language
s += <<~EOS
You may need to: `brew install #{@language}`
EOS
end
s
end
def the_test
case @language
when :lua
["/usr/bin/env", "luarocks-5.2", "show", @import_name.to_s]
when :lua51
["/usr/bin/env", "luarocks-5.1", "show", @import_name.to_s]
when :perl
["/usr/bin/env", "perl", "-e", "use #{@import_name}"]
when :python
["/usr/bin/env", "python2", "-c", "import #{@import_name}"]
when :python3
["/usr/bin/env", "python", "-c", "import #{@import_name}"]
when :ruby
["/usr/bin/env", "ruby", "-rubygems", "-e", "require '#{@import_name}'"]
end
end
def command_line
case @language
when :lua then "luarocks-5.2 install"
when :lua51 then "luarocks-5.1 install"
when :perl then "cpan -i"
when :python then "pip3 install"
when :python3 then "pip install"
when :ruby then "gem install"
end
end
def display_s
"#{@module_name} (#{@language} module)"
end
end

View File

@ -1,29 +0,0 @@
class Formula
def self.sha1(_val)
odisabled "Formula.sha1", "Formula.sha256"
end
end
class SoftwareSpec
def sha1(_val)
odisabled "SoftwareSpec#sha1", "SoftwareSpec#sha256"
end
end
class Resource
def sha1(_val)
odisabled "Resource#sha1", "Resource#sha256"
end
end
class BottleSpecification
def sha1(_val)
odisabled "BottleSpecification#sha1", "BottleSpecification#sha256"
end
end
class Pathname
def sha1
odisabled "Pathname#sha1", "Pathname#sha256"
end
end

View File

@ -1,5 +0,0 @@
class BottleSpecification
def revision(*)
odisabled "BottleSpecification.revision", "BottleSpecification.rebuild"
end
end

View File

@ -1,5 +0,0 @@
class Tab < OpenStruct
def build_32_bit?
odisabled "Tab.build_32_bit?"
end
end

View File

@ -1,6 +0,0 @@
class Tap
def core_formula_repository?
odisabled "Tap#core_formula_repository?", "Tap#core_tap?"
end
end

View File

@ -1,15 +0,0 @@
module Tty
module_function
def white
odisabled "Tty.white", "Tty.reset.bold"
end
end
def puts_columns(_)
odisabled "puts_columns", "puts Formatter.columns"
end
def plural(_, _)
odisabled "#plural", "Formatter.pluralize"
end

View File

@ -1,7 +0,0 @@
module Utils
module Shell
def self.shell_profile
odisabled "Utils::Shell.shell_profile", "Utils::Shell.profile"
end
end
end

View File

@ -1,5 +0,0 @@
class Version
def slice(*)
odisabled "Version#slice", "Version#to_s.slice"
end
end

View File

@ -1,11 +0,0 @@
module OS
module Mac
module Xcode
module_function
def provides_autotools?
odisabled "OS::Mac::Xcode.provides_autotools?"
end
end
end
end

View File

@ -366,7 +366,7 @@ class Pathname
unless method_defined?(:/)
def /(other)
if !other.respond_to?(:to_str) && !other.respond_to?(:to_path)
odeprecated "Pathname#/ with #{other.class}", "a String or a Pathname"
odisabled "Pathname#/ with #{other.class}", "a String or a Pathname"
end
join(other.to_s)
end

View File

@ -2348,7 +2348,7 @@ class Formula
# version '4.8.1'
# end</pre>
def fails_with(compiler, &block)
odeprecated "fails_with :llvm" if compiler == :llvm
odisabled "fails_with :llvm" if compiler == :llvm
specs.each { |spec| spec.fails_with(compiler, &block) }
end

View File

@ -140,7 +140,7 @@ class Requirement
attr_rw :fatal, :cask, :download
def default_formula(_val = nil)
odeprecated "Requirement.default_formula"
odisabled "Requirement.default_formula"
end
def satisfy(options = nil, &block)

View File

@ -128,9 +128,9 @@ class SoftwareSpec
def option(name, description = "")
opt = PREDEFINED_OPTIONS.fetch(name) do
if name.is_a?(Symbol)
odeprecated "passing arbitrary symbols (i.e. #{name.inspect}) to `option`"
name = name.to_s
odisabled "passing arbitrary symbols (i.e. #{name.inspect}) to `option`"
end
unless name.is_a?(String)
raise ArgumentError, "option name must be string or symbol; got a #{name.class}: #{name}"
end
@ -205,7 +205,7 @@ class SoftwareSpec
end
def fails_with(compiler, &block)
odeprecated "fails_with :llvm" if compiler == :llvm
odisabled "fails_with :llvm" if compiler == :llvm
compiler_failures << CompilerFailure.create(compiler, &block)
end

View File

@ -1,22 +0,0 @@
describe "brew linkapps", :integration_test do
let(:home_dir) { mktmpdir }
let(:apps_dir) { home_dir/"Applications" }
it "symlinks applications" do
apps_dir.mkpath
setup_test_formula "testball"
source_app = HOMEBREW_CELLAR/"testball/0.1/TestBall.app"
source_app.mkpath
ENV.delete "HOMEBREW_DEVELOPER"
expect { brew "linkapps", "--local", "HOME" => home_dir }
.to output(/Linking: #{Regexp.escape(source_app)}/).to_stdout
.and output(/'brew linkapps' is deprecated/).to_stderr
.and be_a_success
expect(apps_dir/"TestBall.app").to be_a_symlink
end
end

View File

@ -1,22 +0,0 @@
describe "brew unlinkapps", :integration_test do
let(:home_dir) { mktmpdir }
let(:apps_dir) { home_dir/"Applications" }
it "unlinks symlinked applications" do
apps_dir.mkpath
setup_test_formula "testball"
source_app = HOMEBREW_CELLAR/"testball/0.1/TestBall.app"
source_app.mkpath
FileUtils.ln_s source_app, apps_dir/"TestBall.app"
ENV.delete "HOMEBREW_DEVELOPER"
expect { brew "unlinkapps", "--local", "HOME" => home_dir }
.to output(%r{Unlinking: #{Regexp.escape(apps_dir)}/TestBall.app}).to_stdout
.and output(/'brew unlinkapps' is deprecated/).to_stderr
.and be_a_success
end
end

View File

@ -1,46 +0,0 @@
require "compat/requirements/language_module_requirement"
describe LanguageModuleRequirement, :needs_compat do
specify "unique dependencies are not equal" do
x = described_class.new(:node, "less")
y = described_class.new(:node, "coffee-script")
expect(x).not_to eq(y)
expect(x.hash).not_to eq(y.hash)
end
context "when module and import name differ" do
subject { described_class.new(:python, mod_name, import_name) }
let(:mod_name) { "foo" }
let(:import_name) { "bar" }
its(:message) { is_expected.to include(mod_name) }
its(:the_test) { is_expected.to include("import #{import_name}") }
end
context "when the language is Perl" do
it "does not satisfy invalid dependencies" do
expect(described_class.new(:perl, "notapackage")).not_to be_satisfied
end
it "satisfies valid dependencies" do
expect(described_class.new(:perl, "Env")).to be_satisfied
end
end
context "when the language is Python", :needs_python do
it "does not satisfy invalid dependencies" do
expect(described_class.new(:python, "notapackage")).not_to be_satisfied
end
end
context "when the language is Ruby" do
it "does not satisfy invalid dependencies" do
expect(described_class.new(:ruby, "notapackage")).not_to be_satisfied
end
it "satisfies valid dependencies" do
expect(described_class.new(:ruby, "date")).to be_satisfied
end
end
end

View File

@ -378,9 +378,7 @@ With `--verbose` or `-v`, many commands print extra debugging information. Note
* `prune` [`--dry-run`]:
Remove dead symlinks from the Homebrew prefix. This is generally not
needed, but can be useful when doing DIY installations. Also remove broken
app symlinks from `/Applications` and `~/Applications` that were previously
created by `brew linkapps`.
needed, but can be useful when doing DIY installations.
If `--dry-run` or `-n` is passed, show what would be removed, but do not
actually remove anything.

View File

@ -388,7 +388,7 @@ Rerun the post\-install steps for \fIformula\fR\.
.
.TP
\fBprune\fR [\fB\-\-dry\-run\fR]
Remove dead symlinks from the Homebrew prefix\. This is generally not needed, but can be useful when doing DIY installations\. Also remove broken app symlinks from \fB/Applications\fR and \fB~/Applications\fR that were previously created by \fBbrew linkapps\fR\.
Remove dead symlinks from the Homebrew prefix\. This is generally not needed, but can be useful when doing DIY installations\.
.
.IP
If \fB\-\-dry\-run\fR or \fB\-n\fR is passed, show what would be removed, but do not actually remove anything\.