diff options
| author | Mike McQuaid | 2018-01-21 14:50:34 +0000 |
|---|---|---|
| committer | GitHub | 2018-01-21 14:50:34 +0000 |
| commit | 899ee8261a184391f0ff774a867324e873730124 (patch) | |
| tree | e5bfdbdb49fb17d8344a1933f445183d40df986e /Library | |
| parent | 1c1a1c8d0040ea70217c2a74eb7288240f2bace5 (diff) | |
| parent | ab00c0f719a5646060a9fbd15fbecb1b2a9eb16d (diff) | |
| download | brew-899ee8261a184391f0ff774a867324e873730124.tar.bz2 | |
Merge pull request #3706 from MikeMcQuaid/deprecation-fixes
Deprecation fixes and cleanup
Diffstat (limited to 'Library')
| -rw-r--r-- | Library/Homebrew/cmd/linkapps.rb | 15 | ||||
| -rw-r--r-- | Library/Homebrew/cmd/unlinkapps.rb | 15 | ||||
| -rw-r--r-- | Library/Homebrew/cmd/upgrade.rb | 8 | ||||
| -rw-r--r-- | Library/Homebrew/compat/requirements.rb | 30 | ||||
| -rw-r--r-- | Library/Homebrew/formula_support.rb | 9 | ||||
| -rw-r--r-- | Library/Homebrew/test/cmd/linkapps_spec.rb | 4 | ||||
| -rw-r--r-- | Library/Homebrew/test/cmd/unlinkapps_spec.rb | 4 |
7 files changed, 26 insertions, 59 deletions
diff --git a/Library/Homebrew/cmd/linkapps.rb b/Library/Homebrew/cmd/linkapps.rb index e8d482529..1bec67a04 100644 --- a/Library/Homebrew/cmd/linkapps.rb +++ b/Library/Homebrew/cmd/linkapps.rb @@ -1,3 +1,4 @@ +#: @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). @@ -6,11 +7,6 @@ #: 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. -#: -#: If no <formulae> are provided, all of them will have their apps symlinked. -#: -#: If provided, `--local` will symlink them into the user's `~/Applications` -#: directory instead of the system directory. require "keg" require "formula" @@ -19,14 +15,7 @@ module Homebrew module_function def linkapps - opoo <<~EOS - `brew linkapps` has been deprecated and will eventually be removed! - - 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. - EOS + odeprecated "'brew linkapps'" target_dir = linkapps_target(local: ARGV.include?("--local")) diff --git a/Library/Homebrew/cmd/unlinkapps.rb b/Library/Homebrew/cmd/unlinkapps.rb index 7f401aaeb..721e4d639 100644 --- a/Library/Homebrew/cmd/unlinkapps.rb +++ b/Library/Homebrew/cmd/unlinkapps.rb @@ -1,3 +1,4 @@ +#: @hide_from_man_page #: * `unlinkapps` [`--local`] [`--dry-run`] [<formulae>]: #: Remove symlinks created by `brew linkapps` from `/Applications` (deprecated). #: @@ -5,14 +6,6 @@ #: 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. -#: -#: If no <formulae> are provided, all linked apps will be removed. -#: -#: If provided, `--local` will remove symlinks from the user's `~/Applications` -#: directory instead of the system directory. -#: -#: If `--dry-run` or `-n` is passed, Homebrew will list all symlinks which -#: would be removed, but will not actually delete any files. require "cmd/linkapps" @@ -20,11 +13,7 @@ module Homebrew module_function def unlinkapps - opoo <<~EOS - `brew unlinkapps` has been deprecated and will eventually be removed! - - 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. - EOS + odeprecated "'brew unlinkapps'" target_dir = linkapps_target(local: ARGV.include?("--local")) diff --git a/Library/Homebrew/cmd/upgrade.rb b/Library/Homebrew/cmd/upgrade.rb index 4b03e8080..7832983e3 100644 --- a/Library/Homebrew/cmd/upgrade.rb +++ b/Library/Homebrew/cmd/upgrade.rb @@ -25,13 +25,7 @@ module Homebrew Homebrew.perform_preinstall_checks - if ARGV.include?("--all") - opoo <<~EOS - We decided to not change the behaviour of `brew upgrade` so - `brew upgrade --all` is equivalent to `brew upgrade` without any other - arguments (so the `--all` is a no-op and can be removed). - EOS - end + odeprecated "'brew upgrade --all'", "'brew upgrade'" if ARGV.include?("--all") if ARGV.named.empty? outdated = Formula.installed.select do |f| diff --git a/Library/Homebrew/compat/requirements.rb b/Library/Homebrew/compat/requirements.rb index bffc5f5f1..38344c1fc 100644 --- a/Library/Homebrew/compat/requirements.rb +++ b/Library/Homebrew/compat/requirements.rb @@ -12,7 +12,7 @@ end class EmacsRequirement < Requirement fatal true satisfy do - odeprecated("EmacsRequirement", "'depends_on \"cvs\"'") + odeprecated("EmacsRequirement", "'depends_on \"emacs\"'") which "emacs" end end @@ -20,7 +20,7 @@ end class FortranRequirement < Requirement fatal true satisfy do - odeprecated("FortranRequirement", "'depends_on \"cvs\"'") + odeprecated("FortranRequirement", "'depends_on \"gcc\"'") which "gfortran" end end @@ -28,7 +28,7 @@ end class GitRequirement < Requirement fatal true satisfy do - odeprecated("GitRequirement", "'depends_on \"cvs\"'") + odeprecated("GitRequirement", "'depends_on \"git\"'") which "git" end end @@ -36,7 +36,7 @@ end class GPG2Requirement < Requirement fatal true satisfy do - odeprecated("GPG2Requirement", "'depends_on \"cvs\"'") + odeprecated("GPG2Requirement", "'depends_on \"gnupg\"'") which "gpg" end end @@ -44,7 +44,7 @@ end class MercurialRequirement < Requirement fatal true satisfy do - odeprecated("MercurialRequirement", "'depends_on \"cvs\"'") + odeprecated("MercurialRequirement", "'depends_on \"mercurial\"'") which "hg" end end @@ -52,7 +52,7 @@ end class MPIRequirement < Requirement fatal true satisfy do - odeprecated("MPIRequirement", "'depends_on \"cvs\"'") + odeprecated("MPIRequirement", "'depends_on \"open-mpi\"'") which "mpicc" end end @@ -60,7 +60,7 @@ end class MysqlRequirement < Requirement fatal true satisfy do - odeprecated("MysqlRequirement", "'depends_on \"cvs\"'") + odeprecated("MysqlRequirement", "'depends_on \"mysql\"'") which "mysql_config" end end @@ -68,7 +68,7 @@ end class PerlRequirement < Requirement fatal true satisfy do - odeprecated("PerlRequirement", "'depends_on \"cvs\"'") + odeprecated("PerlRequirement", "'depends_on \"perl\"'") which "perl" end end @@ -76,7 +76,7 @@ end class PostgresqlRequirement < Requirement fatal true satisfy do - odeprecated("PostgresqlRequirement", "'depends_on \"cvs\"'") + odeprecated("PostgresqlRequirement", "'depends_on \"postgresql\"'") which "pg_config" end end @@ -84,7 +84,7 @@ end class PythonRequirement < Requirement fatal true satisfy do - odeprecated("PythonRequirement", "'depends_on \"cvs\"'") + odeprecated("PythonRequirement", "'depends_on \"python\"'") which "python" end end @@ -92,7 +92,7 @@ end class Python3Requirement < Requirement fatal true satisfy do - odeprecated("Python3Requirement", "'depends_on \"cvs\"'") + odeprecated("Python3Requirement", "'depends_on \"python3\"'") which "python3" end end @@ -100,7 +100,7 @@ end class RbenvRequirement < Requirement fatal true satisfy do - odeprecated("RbenvRequirement", "'depends_on \"cvs\"'") + odeprecated("RbenvRequirement", "'depends_on \"rbenv\"'") which "rbenv" end end @@ -108,7 +108,7 @@ end class RubyRequirement < Requirement fatal true satisfy do - odeprecated("RubyRequirement", "'depends_on \"cvs\"'") + odeprecated("RubyRequirement", "'depends_on \"ruby\"'") which "ruby" end end @@ -116,7 +116,7 @@ end class SubversionRequirement < Requirement fatal true satisfy do - odeprecated("SubversionRequirement", "'depends_on \"cvs\"'") + odeprecated("SubversionRequirement", "'depends_on \"subversion\"'") which "svn" end end @@ -126,7 +126,7 @@ class TeXRequirement < Requirement cask "mactex" download "https://www.tug.org/mactex/" satisfy do - odeprecated("TeXRequirement", "'depends_on \"cvs\"'") + odeprecated("TeXRequirement") which("tex") || which("latex") end end diff --git a/Library/Homebrew/formula_support.rb b/Library/Homebrew/formula_support.rb index 011d8a4b7..d44cf158f 100644 --- a/Library/Homebrew/formula_support.rb +++ b/Library/Homebrew/formula_support.rb @@ -34,15 +34,6 @@ class KegOnlyReason return @explanation unless @explanation.empty? case @reason - when :provided_by_osx - odeprecated "keg_only :provided_by_osx", "keg_only :provided_by_macos" - @reason = :provided_by_macos - when :shadowed_by_osx - odeprecated "keg_only :shadowed_by_osx", "keg_only :shadowed_by_macos" - @reason = :shadowed_by_macos - end - - case @reason when :versioned_formula then <<~EOS this is an alternate version of another formula EOS diff --git a/Library/Homebrew/test/cmd/linkapps_spec.rb b/Library/Homebrew/test/cmd/linkapps_spec.rb index 2bca97822..8fc0d5eb9 100644 --- a/Library/Homebrew/test/cmd/linkapps_spec.rb +++ b/Library/Homebrew/test/cmd/linkapps_spec.rb @@ -10,9 +10,11 @@ describe "brew linkapps", :integration_test do 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` has been deprecated/).to_stderr + .and output(/'brew linkapps' is deprecated/).to_stderr .and be_a_success expect(apps_dir/"TestBall.app").to be_a_symlink diff --git a/Library/Homebrew/test/cmd/unlinkapps_spec.rb b/Library/Homebrew/test/cmd/unlinkapps_spec.rb index e1170f435..397a8ec5e 100644 --- a/Library/Homebrew/test/cmd/unlinkapps_spec.rb +++ b/Library/Homebrew/test/cmd/unlinkapps_spec.rb @@ -12,9 +12,11 @@ describe "brew unlinkapps", :integration_test do 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` has been deprecated/).to_stderr + .and output(/'brew unlinkapps' is deprecated/).to_stderr .and be_a_success end end |
