From 2d18ba586b3250062cd58c8f5af81fc30a35bb5f Mon Sep 17 00:00:00 2001 From: Mike McQuaid Date: Fri, 14 Jul 2017 17:03:33 +0100 Subject: [PATCH 1/2] Enable more deprecations. It's been long enough that these have been commented out so let's enable them globally. --- Library/Homebrew/cask/lib/hbc/dsl.rb | 4 +--- Library/Homebrew/compat/software_spec.rb | 2 +- Library/Homebrew/compat/utils.rb | 5 ----- Library/Homebrew/formula.rb | 2 +- Library/Homebrew/software_spec.rb | 2 +- Library/Homebrew/utils.rb | 4 ++++ 6 files changed, 8 insertions(+), 11 deletions(-) diff --git a/Library/Homebrew/cask/lib/hbc/dsl.rb b/Library/Homebrew/cask/lib/hbc/dsl.rb index 112ceb943f..1105ac1a22 100644 --- a/Library/Homebrew/cask/lib/hbc/dsl.rb +++ b/Library/Homebrew/cask/lib/hbc/dsl.rb @@ -204,9 +204,7 @@ module Hbc end def license(*) - # TODO: Uncomment after `license` has been - # removed from all official taps. - # odeprecated "Hbc::DSL#license" + odeprecated "Hbc::DSL#license" end # depends_on uses a load method so that multiple stanzas can be merged diff --git a/Library/Homebrew/compat/software_spec.rb b/Library/Homebrew/compat/software_spec.rb index 5efd2aeb41..8b0408d02f 100644 --- a/Library/Homebrew/compat/software_spec.rb +++ b/Library/Homebrew/compat/software_spec.rb @@ -1,6 +1,6 @@ class BottleSpecification def revision(*args) - # odeprecated "BottleSpecification.revision", "BottleSpecification.rebuild" + odeprecated "BottleSpecification.revision", "BottleSpecification.rebuild" rebuild(*args) end end diff --git a/Library/Homebrew/compat/utils.rb b/Library/Homebrew/compat/utils.rb index f2cca4726d..8904f0f2b4 100644 --- a/Library/Homebrew/compat/utils.rb +++ b/Library/Homebrew/compat/utils.rb @@ -1,8 +1,3 @@ -def shell_profile - # odeprecated "shell_profile", "Utils::Shell.profile" - Utils::Shell.profile -end - module Tty module_function diff --git a/Library/Homebrew/formula.rb b/Library/Homebrew/formula.rb index b2e4ff9889..e681ea0bf4 100644 --- a/Library/Homebrew/formula.rb +++ b/Library/Homebrew/formula.rb @@ -2368,7 +2368,7 @@ class Formula # version '4.8.1' # end def fails_with(compiler, &block) - # odeprecated "fails_with :llvm" if compiler == :llvm + odeprecated "fails_with :llvm" if compiler == :llvm specs.each { |spec| spec.fails_with(compiler, &block) } end diff --git a/Library/Homebrew/software_spec.rb b/Library/Homebrew/software_spec.rb index 0d2b48acc8..c6e7043506 100644 --- a/Library/Homebrew/software_spec.rb +++ b/Library/Homebrew/software_spec.rb @@ -194,7 +194,7 @@ class SoftwareSpec end def fails_with(compiler, &block) - # odeprecated "fails_with :llvm" if compiler == :llvm + odeprecated "fails_with :llvm" if compiler == :llvm compiler_failures << CompilerFailure.create(compiler, &block) end diff --git a/Library/Homebrew/utils.rb b/Library/Homebrew/utils.rb index 5a62953949..e3137ac49c 100644 --- a/Library/Homebrew/utils.rb +++ b/Library/Homebrew/utils.rb @@ -556,3 +556,7 @@ def with_env(hash) ENV.update(old_values) end end + +def shell_profile + Utils::Shell.profile +end From 9578e2995af79e93583c60e667a3db439a14b697 Mon Sep 17 00:00:00 2001 From: Markus Reiter Date: Sat, 15 Jul 2017 14:46:11 +0200 Subject: [PATCH 2/2] Move `Hbc::DSL#license` to `compat`. --- Library/Homebrew/cask/lib/hbc/dsl.rb | 4 ---- Library/Homebrew/compat/hbc.rb | 1 + Library/Homebrew/compat/hbc/dsl.rb | 7 +++++++ 3 files changed, 8 insertions(+), 4 deletions(-) create mode 100644 Library/Homebrew/compat/hbc/dsl.rb diff --git a/Library/Homebrew/cask/lib/hbc/dsl.rb b/Library/Homebrew/cask/lib/hbc/dsl.rb index 1105ac1a22..4045c6dcff 100644 --- a/Library/Homebrew/cask/lib/hbc/dsl.rb +++ b/Library/Homebrew/cask/lib/hbc/dsl.rb @@ -203,10 +203,6 @@ module Hbc @sha256 ||= arg end - def license(*) - odeprecated "Hbc::DSL#license" - end - # depends_on uses a load method so that multiple stanzas can be merged def depends_on(*args) @depends_on ||= DSL::DependsOn.new diff --git a/Library/Homebrew/compat/hbc.rb b/Library/Homebrew/compat/hbc.rb index 3ff8fccb7c..608d46e376 100644 --- a/Library/Homebrew/compat/hbc.rb +++ b/Library/Homebrew/compat/hbc.rb @@ -3,6 +3,7 @@ require "compat/hbc/cli/update" require "compat/hbc/cache" require "compat/hbc/caskroom" require "compat/hbc/cli" +require "compat/hbc/dsl" module Hbc class << self diff --git a/Library/Homebrew/compat/hbc/dsl.rb b/Library/Homebrew/compat/hbc/dsl.rb new file mode 100644 index 0000000000..b550501ed5 --- /dev/null +++ b/Library/Homebrew/compat/hbc/dsl.rb @@ -0,0 +1,7 @@ +module Hbc + class DSL + def license(*) + odeprecated "Hbc::DSL#license" + end + end +end