Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Disable more deprecations. #4392

Merged
merged 2 commits into from
Jul 15, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion Library/Homebrew/cmd/tap.rb
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ def tap
if ARGV.include? "--repair"
Tap.each(&:link_completions_and_manpages)
elsif ARGV.include? "--list-official"
odeprecated("brew tap --list-official")
odisabled("brew tap --list-official")
elsif ARGV.include? "--list-pinned"
puts Tap.select(&:pinned?).map(&:name)
elsif ARGV.named.empty?
Expand Down
2 changes: 0 additions & 2 deletions Library/Homebrew/cmd/upgrade.rb
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,6 @@ def upgrade

Install.perform_preinstall_checks

odisabled "'brew upgrade --all'", "'brew upgrade'" if ARGV.include?("--all")

if ARGV.named.empty?
outdated = Formula.installed.select do |f|
f.outdated?(fetch_head: ARGV.fetch_head?)
Expand Down
15 changes: 5 additions & 10 deletions Library/Homebrew/compat.rb
Original file line number Diff line number Diff line change
@@ -1,12 +1,7 @@
require "compat/hbc"
require "compat/formula"
require "compat/formula_support"
require "compat/requirements"
require "compat/download_strategy"
require "compat/dependency_collector"
require "compat/ENV/shared"
require "compat/extend/string"
require "compat/gpg"
require "compat/dependable"
require "compat/os/mac"
require "compat/dependable"
require "compat/dependency_collector"
require "compat/fileutils"
require "compat/formula_support"
require "compat/hbc"
require "compat/tap"
13 changes: 0 additions & 13 deletions Library/Homebrew/compat/ENV/shared.rb

This file was deleted.

2 changes: 1 addition & 1 deletion Library/Homebrew/compat/dependable.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
module Dependable
module Compat
def run?
odeprecated "Dependable#run?"
odisabled "Dependable#run?"
tags.include? :run
end
end
Expand Down
52 changes: 1 addition & 51 deletions Library/Homebrew/compat/dependency_collector.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,60 +2,10 @@

class DependencyCollector
module Compat
# Define the languages that we can handle as external dependencies.
LANGUAGE_MODULES = Set[
:lua, :lua51, :perl, :python, :python3, :ruby
].freeze

def parse_string_spec(spec, tags)
if (tag = tags.first) && LANGUAGE_MODULES.include?(tag)
odisabled "'depends_on ... => #{tag.inspect}'"
end

if tags.include?(:run)
odeprecated "'depends_on ... => :run'"
end

odisabled "'depends_on ... => :run'" if tags.include?(:run)
super
end

def parse_symbol_spec(spec, tags)
case spec
when :clt
odisabled "'depends_on :clt'"
when :tex
odisabled "'depends_on :tex'"
when :libltdl
output_disabled(spec, "libtool")
when :apr
output_disabled(spec, "apr-util")
when :fortran
output_disabled(spec, "gcc")
when :gpg
output_disabled(spec, "gnupg")
when :hg
output_disabled(spec, "mercurial")
when :mpi
output_disabled(spec, "open-mpi")
when :python, :python2
output_disabled(spec, "python@2")
when :python3
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
end

private

def output_disabled(dependency, new_dependency = dependency)
odisabled "'depends_on :#{dependency}'",
"'depends_on \"#{new_dependency}\"'"
end
end

prepend Compat
Expand Down
6 changes: 0 additions & 6 deletions Library/Homebrew/compat/download_strategy.rb

This file was deleted.

23 changes: 0 additions & 23 deletions Library/Homebrew/compat/extend/string.rb

This file was deleted.

7 changes: 6 additions & 1 deletion Library/Homebrew/compat/fileutils.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,13 @@

module FileUtils
module Compat
def ruby(*args)
odeprecated "ruby", 'system "ruby"'
system RUBY_PATH, *args
end

def mktemp(prefix = name, opts = {})
# odeprecated("FileUtils.mktemp", "mktemp")
odeprecated("FileUtils.mktemp", "mktemp")
Mktemp.new(prefix, opts).run do |staging|
yield staging
end
Expand Down
9 changes: 0 additions & 9 deletions Library/Homebrew/compat/formula.rb

This file was deleted.

32 changes: 12 additions & 20 deletions Library/Homebrew/compat/formula_support.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,27 +4,23 @@ class KegOnlyReason
module Compat
def valid?
case @reason
when :provided_by_osx
odisabled "keg_only :provided_by_osx", "keg_only :provided_by_macos"
when :shadowed_by_osx
odisabled "keg_only :shadowed_by_osx", "keg_only :shadowed_by_macos"
when :provided_pre_mountain_lion
odeprecated "keg_only :provided_pre_mountain_lion"
odisabled "keg_only :provided_pre_mountain_lion"
MacOS.version < :mountain_lion
when :provided_pre_mavericks
odeprecated "keg_only :provided_pre_mavericks"
odisabled "keg_only :provided_pre_mavericks"
MacOS.version < :mavericks
when :provided_pre_el_capitan
odeprecated "keg_only :provided_pre_el_capitan"
odisabled "keg_only :provided_pre_el_capitan"
MacOS.version < :el_capitan
when :provided_pre_high_sierra
odeprecated "keg_only :provided_pre_high_sierra"
odisabled "keg_only :provided_pre_high_sierra"
MacOS.version < :high_sierra
when :provided_until_xcode43
odeprecated "keg_only :provided_until_xcode43"
odisabled "keg_only :provided_until_xcode43"
MacOS::Xcode.version < "4.3"
when :provided_until_xcode5
odeprecated "keg_only :provided_until_xcode5"
odisabled "keg_only :provided_until_xcode5"
MacOS::Xcode.version < "5.0"
else
super
Expand All @@ -33,42 +29,38 @@ def valid?

def to_s
case @reason
when :provided_by_osx
odisabled "keg_only :provided_by_osx", "keg_only :provided_by_macos"
when :shadowed_by_osx
odisabled "keg_only :shadowed_by_osx", "keg_only :shadowed_by_macos"
when :provided_pre_mountain_lion
odeprecated "keg_only :provided_pre_mountain_lion"
odisabled "keg_only :provided_pre_mountain_lion"

<<~EOS
macOS already provides this software in versions before Mountain Lion
EOS
when :provided_pre_mavericks
odeprecated "keg_only :provided_pre_mavericks"
odisabled "keg_only :provided_pre_mavericks"

<<~EOS
macOS already provides this software in versions before Mavericks
EOS
when :provided_pre_el_capitan
odeprecated "keg_only :provided_pre_el_capitan"
odisabled "keg_only :provided_pre_el_capitan"

<<~EOS
macOS already provides this software in versions before El Capitan
EOS
when :provided_pre_high_sierra
odeprecated "keg_only :provided_pre_high_sierra"
odisabled "keg_only :provided_pre_high_sierra"

<<~EOS
macOS already provides this software in versions before High Sierra
EOS
when :provided_until_xcode43
odeprecated "keg_only :provided_until_xcode43"
odisabled "keg_only :provided_until_xcode43"

<<~EOS
Xcode provides this software prior to version 4.3
EOS
when :provided_until_xcode5
odeprecated "keg_only :provided_until_xcode5"
odisabled "keg_only :provided_until_xcode5"

<<~EOS
Xcode provides this software prior to version 5
Expand Down
27 changes: 0 additions & 27 deletions Library/Homebrew/compat/gpg.rb

This file was deleted.

2 changes: 0 additions & 2 deletions Library/Homebrew/compat/hbc.rb
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
require "compat/hbc/cask_loader"
require "compat/hbc/cli/search"
require "compat/hbc/cli/update"
require "compat/hbc/cache"
require "compat/hbc/caskroom"
require "compat/hbc/cli"
require "compat/hbc/dsl"

module Hbc
Expand Down
2 changes: 1 addition & 1 deletion Library/Homebrew/compat/hbc/cask_loader.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ module Compat

def cask(header_token, **options, &block)
if header_token.is_a?(Hash) && header_token.key?(:v1)
odeprecated %q("cask :v1 => 'token'"), %q("cask 'token'")
odisabled %q("cask :v1 => 'token'"), %q("cask 'token'")
header_token = header_token[:v1]
end

Expand Down
18 changes: 0 additions & 18 deletions Library/Homebrew/compat/hbc/cli.rb

This file was deleted.

19 changes: 0 additions & 19 deletions Library/Homebrew/compat/hbc/cli/update.rb

This file was deleted.

2 changes: 1 addition & 1 deletion Library/Homebrew/compat/hbc/dsl.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ module Hbc
class DSL
module Compat
def license(*)
odeprecated "Hbc::DSL#license"
odisabled "Hbc::DSL#license"
end
end

Expand Down
2 changes: 1 addition & 1 deletion Library/Homebrew/compat/os/mac.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ module Mac
class << self
module Compat
def release
odeprecated "MacOS.release", "MacOS.version"
odisabled "MacOS.release", "MacOS.version"
version
end
end
Expand Down