aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--.gitignore1
-rw-r--r--Library/.rubocop.yml10
-rw-r--r--Library/Homebrew/.rubocop.yml5
-rw-r--r--Library/Homebrew/cask/lib/hbc/artifact/moved.rb2
-rw-r--r--Library/Homebrew/cask/lib/hbc/cli/doctor.rb10
-rw-r--r--Library/Homebrew/cmd/info.rb2
-rw-r--r--Library/Homebrew/cmd/reinstall.rb2
-rw-r--r--Library/Homebrew/cmd/style.rb1
-rw-r--r--Library/Homebrew/cmd/upgrade.rb2
-rw-r--r--Library/Homebrew/cmd/vendor-install.sh31
-rw-r--r--Library/Homebrew/compat/ARGV.rb3
-rw-r--r--Library/Homebrew/compat/ENV/shared.rb2
-rw-r--r--Library/Homebrew/compat/ENV/std.rb14
-rw-r--r--Library/Homebrew/compat/ENV/super.rb24
-rw-r--r--Library/Homebrew/compat/build_options.rb6
-rw-r--r--Library/Homebrew/compat/dependency_collector.rb67
-rw-r--r--Library/Homebrew/compat/extend/string.rb1
-rw-r--r--Library/Homebrew/compat/fails_with_llvm.rb4
-rw-r--r--Library/Homebrew/compat/formula.rb54
-rw-r--r--Library/Homebrew/compat/formula_specialties.rb36
-rw-r--r--Library/Homebrew/compat/formula_support.rb18
-rw-r--r--Library/Homebrew/compat/global.rb3
-rw-r--r--Library/Homebrew/compat/gpg.rb36
-rw-r--r--Library/Homebrew/compat/hardware.rb24
-rw-r--r--Library/Homebrew/compat/json.rb30
-rw-r--r--Library/Homebrew/compat/keg.rb3
-rw-r--r--Library/Homebrew/compat/language/haskell.rb3
-rw-r--r--Library/Homebrew/compat/macos.rb85
-rw-r--r--Library/Homebrew/compat/pathname.rb16
-rw-r--r--Library/Homebrew/compat/requirements.rb156
-rw-r--r--Library/Homebrew/compat/requirements/emacs_requirement.rb35
-rw-r--r--Library/Homebrew/compat/requirements/fortran_requirement.rb13
-rw-r--r--Library/Homebrew/compat/requirements/mpi_requirement.rb66
-rw-r--r--Library/Homebrew/compat/requirements/perl_requirement.rb36
-rw-r--r--Library/Homebrew/compat/requirements/python_requirement.rb68
-rw-r--r--Library/Homebrew/compat/requirements/ruby_requirement.rb56
-rw-r--r--Library/Homebrew/compat/requirements/tex_requirement.rb20
-rw-r--r--Library/Homebrew/compat/software_spec.rb5
-rw-r--r--Library/Homebrew/compat/tab.rb3
-rw-r--r--Library/Homebrew/compat/tap.rb3
-rw-r--r--Library/Homebrew/compat/utils.rb13
-rw-r--r--Library/Homebrew/compat/utils/shell.rb3
-rw-r--r--Library/Homebrew/compat/version.rb5
-rw-r--r--Library/Homebrew/compat/xcode.rb3
-rw-r--r--Library/Homebrew/constants.rb5
-rw-r--r--Library/Homebrew/dev-cmd/create.rb134
-rw-r--r--Library/Homebrew/dev-cmd/pull.rb2
-rw-r--r--Library/Homebrew/extend/os/linux/requirements/java_requirement.rb2
-rw-r--r--Library/Homebrew/formula.rb23
-rw-r--r--Library/Homebrew/formula_installer.rb6
-rw-r--r--Library/Homebrew/formula_support.rb14
-rw-r--r--Library/Homebrew/keg.rb7
-rw-r--r--Library/Homebrew/rubocops/bottle_block_cop.rb2
-rw-r--r--Library/Homebrew/rubocops/checksum_cop.rb2
-rw-r--r--Library/Homebrew/rubocops/class_cop.rb2
-rw-r--r--Library/Homebrew/rubocops/components_order_cop.rb4
-rw-r--r--Library/Homebrew/rubocops/extend/formula_cop.rb2
-rw-r--r--Library/Homebrew/rubocops/formula_desc_cop.rb2
-rw-r--r--Library/Homebrew/rubocops/urls_cop.rb2
-rw-r--r--Library/Homebrew/test/Gemfile1
-rw-r--r--Library/Homebrew/test/Gemfile.lock17
-rw-r--r--Library/Homebrew/test/cask/dsl_spec.rb5
-rw-r--r--Library/Homebrew/test/cmd/style_spec.rb2
-rw-r--r--Library/Homebrew/test/dependency_collector_spec.rb5
-rw-r--r--Library/Homebrew/test/mpi_requirement_spec.rb9
-rw-r--r--Library/Homebrew/test/support/helper/output_as_tty.rb4
-rw-r--r--Library/Homebrew/utils.rb3
-rw-r--r--Library/Homebrew/utils/curl.rb11
-rw-r--r--Library/Homebrew/utils/github.rb2
-rw-r--r--completions/bash/brew77
-rw-r--r--completions/zsh/_brew4
-rw-r--r--completions/zsh/_brew_cask8
-rw-r--r--docs/.ruby-version2
-rw-r--r--docs/Formula-Cookbook.md39
-rw-r--r--docs/Gemfile3
-rw-r--r--docs/Gemfile.lock219
-rw-r--r--docs/Homebrew-and-Python.md4
-rw-r--r--docs/Interesting-Taps-and-Forks.md4
-rw-r--r--docs/Node-for-Formula-Authors.md6
-rw-r--r--docs/Python-for-Formula-Authors.md14
80 files changed, 765 insertions, 863 deletions
diff --git a/.gitignore b/.gitignore
index b70874d2f..4d78ef02d 100644
--- a/.gitignore
+++ b/.gitignore
@@ -45,7 +45,6 @@
/docs/.bundle
/docs/bin
/docs/vendor
-/docs/Gemfile.lock
/docs/.jekyll-metadata
# Unignore our shell completion
diff --git a/Library/.rubocop.yml b/Library/.rubocop.yml
index 051a57f93..d93d1bd8b 100644
--- a/Library/.rubocop.yml
+++ b/Library/.rubocop.yml
@@ -123,6 +123,14 @@ Style/Documentation:
Style/Encoding:
Enabled: true
+# disabled until we get the Metrics/LineLength down to 80.
+Style/IfUnlessModifier:
+ Enabled: false
+
+# messes with existing plist/caveats style
+Style/TrailingBodyOnMethodDefinition:
+ Enabled: false
+
# use spaces for indentation; detect tabs
Layout/Tab:
Enabled: true
@@ -214,7 +222,7 @@ Style/FrozenStringLiteralComment:
Enabled: false
# generally rescuing StandardError is fine
-Lint/RescueWithoutErrorClass:
+Style/RescueStandardError:
Enabled: false
# implicitly allow EOS as we use it everywhere
diff --git a/Library/Homebrew/.rubocop.yml b/Library/Homebrew/.rubocop.yml
index 354867738..e0089e050 100644
--- a/Library/Homebrew/.rubocop.yml
+++ b/Library/Homebrew/.rubocop.yml
@@ -5,6 +5,7 @@ AllCops:
Include:
- '**/.simplecov'
Exclude:
+ - 'bin/*'
- '**/Casks/**/*'
- '**/vendor/**/*'
@@ -79,3 +80,7 @@ Style/GuardClause:
# hash-rockets preferred for formulae, a: 1 preferred elsewhere
Style/HashSyntax:
EnforcedStyle: ruby19_no_mixed_keys
+
+# so many of these in formulae but none in here
+Style/TrailingBodyOnMethodDefinition:
+ Enabled: true
diff --git a/Library/Homebrew/cask/lib/hbc/artifact/moved.rb b/Library/Homebrew/cask/lib/hbc/artifact/moved.rb
index f5ef790eb..856ab2766 100644
--- a/Library/Homebrew/cask/lib/hbc/artifact/moved.rb
+++ b/Library/Homebrew/cask/lib/hbc/artifact/moved.rb
@@ -65,7 +65,7 @@ module Hbc
ohai "Moving #{self.class.english_name} '#{target.basename}' back to '#{source}'."
source.dirname.mkpath
- if source.parent.writable?
+ if target.parent.writable?
FileUtils.move(target, source)
else
command.run("/bin/mv", args: [target, source], sudo: true)
diff --git a/Library/Homebrew/cask/lib/hbc/cli/doctor.rb b/Library/Homebrew/cask/lib/hbc/cli/doctor.rb
index d7bcf1537..5aef2c420 100644
--- a/Library/Homebrew/cask/lib/hbc/cli/doctor.rb
+++ b/Library/Homebrew/cask/lib/hbc/cli/doctor.rb
@@ -12,6 +12,7 @@ module Hbc
def run
ohai "Homebrew-Cask Version", Hbc.full_version
ohai "macOS", MacOS.full_version
+ ohai "SIP", self.class.check_sip
ohai "Java", SystemConfig.describe_java
ohai "Homebrew-Cask Install Location", self.class.render_install_location
ohai "Homebrew-Cask Staging Location", self.class.render_staging_location(Hbc.caskroom)
@@ -37,6 +38,15 @@ module Hbc
(self.class.locale_variables + environment_variables).sort.each(&self.class.method(:render_env_var))
end
+ def self.check_sip
+ csrutil = "/usr/bin/csrutil"
+ return "N/A" unless File.executable?(csrutil)
+ Open3.capture2(csrutil, "status")[0]
+ .gsub("This is an unsupported configuration, likely to break in the future and leave your machine in an unknown state.", "")
+ .gsub("System Integrity Protection status: ", "")
+ .delete("\t\.").capitalize.strip
+ end
+
def self.locale_variables
ENV.keys.grep(/^(?:LC_\S+|LANG|LANGUAGE)\Z/).sort
end
diff --git a/Library/Homebrew/cmd/info.rb b/Library/Homebrew/cmd/info.rb
index 83bb712ab..a78159a15 100644
--- a/Library/Homebrew/cmd/info.rb
+++ b/Library/Homebrew/cmd/info.rb
@@ -164,7 +164,7 @@ module Homebrew
end
end
- unless f.options.empty?
+ if !f.options.empty? || f.head || f.devel
ohai "Options"
Homebrew.dump_options_for_formula f
end
diff --git a/Library/Homebrew/cmd/reinstall.rb b/Library/Homebrew/cmd/reinstall.rb
index a4629025a..53c923d91 100644
--- a/Library/Homebrew/cmd/reinstall.rb
+++ b/Library/Homebrew/cmd/reinstall.rb
@@ -39,7 +39,7 @@ module Homebrew
fi.build_bottle = ARGV.build_bottle? || (!f.bottled? && f.build.bottle?)
fi.interactive = ARGV.interactive?
fi.git = ARGV.git?
- fi.link_keg = keg_was_linked if keg_had_linked_opt
+ fi.link_keg ||= keg_was_linked if keg_had_linked_opt
fi.prelude
oh1 "Reinstalling #{f.full_name} #{options.to_a.join " "}"
diff --git a/Library/Homebrew/cmd/style.rb b/Library/Homebrew/cmd/style.rb
index 27047dfd0..89484d67d 100644
--- a/Library/Homebrew/cmd/style.rb
+++ b/Library/Homebrew/cmd/style.rb
@@ -70,7 +70,6 @@ module Homebrew
def check_style_impl(files, output_type, options = {})
fix = options[:fix]
- Homebrew.install_gem_setup_path! "parser", HOMEBREW_RUBOCOP_PARSER_VERSION, "ruby-parse"
Homebrew.install_gem_setup_path! "rubocop", HOMEBREW_RUBOCOP_VERSION
require "rubocop"
require_relative "../rubocops"
diff --git a/Library/Homebrew/cmd/upgrade.rb b/Library/Homebrew/cmd/upgrade.rb
index 1c9c89d76..4b03e8080 100644
--- a/Library/Homebrew/cmd/upgrade.rb
+++ b/Library/Homebrew/cmd/upgrade.rb
@@ -133,7 +133,7 @@ module Homebrew
fi.options = options
fi.build_bottle = ARGV.build_bottle? || (!f.bottled? && f.build.build_bottle?)
fi.installed_on_request = !ARGV.named.empty?
- fi.link_keg = keg_was_linked if keg_had_linked_opt
+ fi.link_keg ||= keg_was_linked if keg_had_linked_opt
if tab
fi.installed_as_dependency = tab.installed_as_dependency
fi.installed_on_request ||= tab.installed_on_request
diff --git a/Library/Homebrew/cmd/vendor-install.sh b/Library/Homebrew/cmd/vendor-install.sh
index bf6fe0c59..3b91dae5c 100644
--- a/Library/Homebrew/cmd/vendor-install.sh
+++ b/Library/Homebrew/cmd/vendor-install.sh
@@ -8,26 +8,26 @@ source "$HOMEBREW_LIBRARY/Homebrew/utils/lock.sh"
VENDOR_DIR="$HOMEBREW_LIBRARY/Homebrew/vendor"
-# Built from https://github.com/Homebrew/homebrew-portable.
+# Built from https://github.com/Homebrew/homebrew-portable-ruby.
if [[ -n "$HOMEBREW_MACOS" ]]
then
if [[ "$HOMEBREW_PROCESSOR" = "Intel" ]]
then
- ruby_URL="https://homebrew.bintray.com/bottles-portable/portable-ruby-2.3.3.leopard_64.bottle.1.tar.gz"
+ ruby_URL="https://homebrew.bintray.com/bottles-portable-ruby/portable-ruby-2.3.3.leopard_64.bottle.1.tar.gz"
+ ruby_URL2="https://github.com/Homebrew/homebrew-portable-ruby/releases/download/2.3.3/portable-ruby-2.3.3.leopard_64.bottle.1.tar.gz"
ruby_SHA="34ce9e4c9c1be28db564d744165aa29291426f8a3d2ef806ba4f0b9175aedb2b"
- else
- ruby_URL=""
- ruby_SHA=""
fi
elif [[ -n "$HOMEBREW_LINUX" ]]
then
case "$HOMEBREW_PROCESSOR" in
armv7l)
- ruby_URL="https://homebrew.bintray.com/bottles-portable/portable-ruby-2.3.3.armv7l_linux.bottle.1.tar.gz"
+ ruby_URL="https://homebrew.bintray.com/bottles-portable-ruby/portable-ruby-2.3.3.armv7l_linux.bottle.1.tar.gz"
+ ruby_URL2="https://github.com/Homebrew/homebrew-portable-ruby/releases/download/2.3.3/portable-ruby-2.3.3.armv7l_linux.bottle.1.tar.gz"
ruby_SHA="d26affe6f6ac299557a9044b311b4066b554874fc828ebc323d2705d3f4a8249"
;;
x86_64)
- ruby_URL="https://homebrew.bintray.com/bottles-portable/portable-ruby-2.3.3.x86_64_linux.bottle.1.tar.gz"
+ ruby_URL="https://homebrew.bintray.com/bottles-portable-ruby/portable-ruby-2.3.3.x86_64_linux.bottle.1.tar.gz"
+ ruby_URL2="https://github.com/Homebrew/homebrew-portable-ruby/releases/download/2.3.3/portable-ruby-2.3.3.x86_64_linux.bottle.1.tar.gz"
ruby_SHA="33643b1ca6f860d6df01686636326785763e5e81cf0cef37d8a7ab96a6ca1fa1"
;;
esac
@@ -90,7 +90,20 @@ fetch() {
if [[ ! -f "$temporary_path" ]]
then
- odie "Download failed: $VENDOR_URL"
+ [[ -n "$HOMEBREW_QUIET" ]] || echo "==> Downloading $VENDOR_URL2" >&2
+ "$HOMEBREW_CURL" "${curl_args[@]}" "$VENDOR_URL2" -o "$temporary_path"
+ fi
+
+ if [[ ! -f "$temporary_path" ]]
+ then
+ odie <<EOS
+Failed to download $VENDOR_URL and $VENDOR_URL2!
+
+Do not file an issue on GitHub about this: you will need to figure out for
+yourself what issue with your internet connection restricts your access to
+both Bintray (used for Homebrew bottles/binary packages) and GitHub
+(used for Homebrew updates).
+EOS
fi
trap '' SIGINT
@@ -211,8 +224,10 @@ homebrew-vendor-install() {
[[ -n "$HOMEBREW_DEBUG" ]] && set -x
url_var="${VENDOR_NAME}_URL"
+ url2_var="${VENDOR_NAME}_URL2"
sha_var="${VENDOR_NAME}_SHA"
VENDOR_URL="${!url_var}"
+ VENDOR_URL2="${!url2_var}"
VENDOR_SHA="${!sha_var}"
if [[ -z "$VENDOR_URL" || -z "$VENDOR_SHA" ]]
diff --git a/Library/Homebrew/compat/ARGV.rb b/Library/Homebrew/compat/ARGV.rb
index e5fa8188f..e56c4e01f 100644
--- a/Library/Homebrew/compat/ARGV.rb
+++ b/Library/Homebrew/compat/ARGV.rb
@@ -1,6 +1,5 @@
module HomebrewArgvExtension
def build_32_bit?
- odeprecated "ARGV.build_32_bit?"
- include? "--32-bit"
+ odisabled "ARGV.build_32_bit?"
end
end
diff --git a/Library/Homebrew/compat/ENV/shared.rb b/Library/Homebrew/compat/ENV/shared.rb
index c700b1e00..36ee45627 100644
--- a/Library/Homebrew/compat/ENV/shared.rb
+++ b/Library/Homebrew/compat/ENV/shared.rb
@@ -5,6 +5,6 @@ module SharedEnvExtension
end
def java_cache
- # odeprecated "ENV.java_cache"
+ odeprecated "ENV.java_cache"
end
end
diff --git a/Library/Homebrew/compat/ENV/std.rb b/Library/Homebrew/compat/ENV/std.rb
index 26dabe440..beca4ed6f 100644
--- a/Library/Homebrew/compat/ENV/std.rb
+++ b/Library/Homebrew/compat/ENV/std.rb
@@ -1,27 +1,25 @@
module Stdenv
def fast
- odeprecated "ENV.fast"
+ odisabled "ENV.fast"
end
def O4
- odeprecated "ENV.O4"
+ odisabled "ENV.O4"
end
def Og
- odeprecated "ENV.Og"
+ odisabled "ENV.Og"
end
def gcc_4_0_1
- odeprecated "ENV.gcc_4_0_1", "ENV.gcc_4_0"
- gcc_4_0
+ odisabled "ENV.gcc_4_0_1", "ENV.gcc_4_0"
end
def gcc
- odeprecated "ENV.gcc", "ENV.gcc_4_2"
- gcc_4_2
+ odisabled "ENV.gcc", "ENV.gcc_4_2"
end
def libpng
- odeprecated "ENV.libpng", "ENV.x11"
+ odisabled "ENV.libpng", "ENV.x11"
end
end
diff --git a/Library/Homebrew/compat/ENV/super.rb b/Library/Homebrew/compat/ENV/super.rb
index 2020ad752..53a6bdc4d 100644
--- a/Library/Homebrew/compat/ENV/super.rb
+++ b/Library/Homebrew/compat/ENV/super.rb
@@ -1,47 +1,45 @@
module Superenv
def fast
- odeprecated "ENV.fast"
+ odisabled "ENV.fast"
end
def O4
- odeprecated "ENV.O4"
+ odisabled "ENV.O4"
end
def Og
- odeprecated "ENV.Og"
+ odisabled "ENV.Og"
end
def gcc_4_0_1
- odeprecated "ENV.gcc_4_0_1", "ENV.gcc_4_0"
- gcc_4_0
+ odisabled "ENV.gcc_4_0_1", "ENV.gcc_4_0"
end
def gcc
- odeprecated "ENV.gcc", "ENV.gcc_4_2"
- gcc_4_2
+ odisabled "ENV.gcc", "ENV.gcc_4_2"
end
def libxml2
- odeprecated "ENV.libxml2"
+ odisabled "ENV.libxml2"
end
def minimal_optimization
- odeprecated "ENV.minimal_optimization"
+ odisabled "ENV.minimal_optimization"
end
def no_optimization
- odeprecated "ENV.no_optimization"
+ odisabled "ENV.no_optimization"
end
def enable_warnings
- odeprecated "ENV.enable_warnings"
+ odisabled "ENV.enable_warnings"
end
def macosxsdk
- odeprecated "ENV.macosxsdk"
+ odisabled "ENV.macosxsdk"
end
def remove_macosxsdk
- odeprecated "ENV.remove_macosxsdk"
+ odisabled "ENV.remove_macosxsdk"
end
end
diff --git a/Library/Homebrew/compat/build_options.rb b/Library/Homebrew/compat/build_options.rb
index 73722dadb..6e566a08c 100644
--- a/Library/Homebrew/compat/build_options.rb
+++ b/Library/Homebrew/compat/build_options.rb
@@ -1,11 +1,9 @@
class BuildOptions
def build_32_bit?
- odeprecated "build.build_32_bit?"
- include?("32-bit") && option_defined?("32-bit")
+ odisabled "build.build_32_bit?"
end
def build_bottle?
- odeprecated "build.build_bottle?", "build.bottle?"
- bottle?
+ odisabled "build.build_bottle?", "build.bottle?"
end
end
diff --git a/Library/Homebrew/compat/dependency_collector.rb b/Library/Homebrew/compat/dependency_collector.rb
index 82511bcc7..1c91f2283 100644
--- a/Library/Homebrew/compat/dependency_collector.rb
+++ b/Library/Homebrew/compat/dependency_collector.rb
@@ -10,6 +10,7 @@ class DependencyCollector
def parse_string_spec(spec, tags)
if (tag = tags.first) && LANGUAGE_MODULES.include?(tag)
+ odeprecated "'depends_on :#{tag}'"
LanguageModuleRequirement.new(tag, spec, tags[1])
else
_parse_string_spec(spec, tags)
@@ -23,60 +24,45 @@ class DependencyCollector
when :clt
odeprecated "'depends_on :clt'"
when :tex
- # odeprecated "'depends_on :tex'"
+ odeprecated "'depends_on :tex'"
TeXRequirement.new(tags)
when :autoconf, :automake, :bsdmake, :libtool
- output_deprecation(spec, tags)
+ output_deprecation(spec)
autotools_dep(spec, tags)
when :cairo, :fontconfig, :freetype, :libpng, :pixman
- output_deprecation(spec, tags)
+ output_deprecation(spec)
Dependency.new(spec.to_s, tags)
when :ant, :expat
- # output_deprecation(spec, tags)
+ output_deprecation(spec)
Dependency.new(spec.to_s, tags)
when :libltdl
tags << :run
- output_deprecation("libtool", tags)
+ output_deprecation("libtool")
Dependency.new("libtool", tags)
when :apr
- # output_deprecation(spec, tags, "apr-util")
+ output_deprecation(spec, "apr-util")
Dependency.new("apr-util", tags)
when :fortran
- # output_deprecation(spec, tags, "gcc")
- FortranRequirement.new(tags)
+ output_deprecation(spec, "gcc")
+ Dependency.new("gcc", tags)
when :gpg
- # output_deprecation(spec, tags, "gnupg")
- GPG2Requirement.new(tags)
+ output_deprecation(spec, "gnupg")
+ Dependency.new("gnupg", tags)
when :hg
- # output_deprecation(spec, tags, "mercurial")
- MercurialRequirement.new(tags)
+ output_deprecation(spec, "mercurial")
+ Dependency.new("mercurial", tags)
when :mpi
- # output_deprecation(spec, tags, "open-mpi")
- MPIRequirement.new(*tags)
- when :emacs
- # output_deprecation(spec, tags)
- EmacsRequirement.new(tags)
- when :mysql
- # output_deprecation(spec, tags)
- MysqlRequirement.new(tags)
- when :perl
- # output_deprecation(spec, tags)
- PerlRequirement.new(tags)
- when :postgresql
- # output_deprecation(spec, tags)
- PostgresqlRequirement.new(tags)
+ output_deprecation(spec, "open-mpi")
+ Dependency.new("open-mpi", tags)
when :python, :python2
- # output_deprecation(spec, tags)
- PythonRequirement.new(tags)
+ output_deprecation(spec, "python")
+ Dependency.new("python", tags)
when :python3
- # output_deprecation(spec, tags)
- Python3Requirement.new(tags)
- when :rbenv
- # output_deprecation(spec, tags)
- RbenvRequirement.new(tags)
- when :ruby
- # output_deprecation(spec, tags)
- RubyRequirement.new(tags)
+ output_deprecation(spec, "python3")
+ Dependency.new("python3", tags)
+ when :emacs, :mysql, :perl, :postgresql, :rbenv, :ruby
+ output_deprecation(spec)
+ Dependency.new(spec, tags)
else
_parse_symbol_spec(spec, tags)
end
@@ -87,13 +73,8 @@ class DependencyCollector
Dependency.new(spec.to_s, tags)
end
- def output_deprecation(dependency, tags, new_dependency = dependency)
- tags_string = if tags.length > 1
- " => [:#{tags.join ", :"}]"
- elsif tags.length == 1
- " => :#{tags.first}"
- end
+ def output_deprecation(dependency, new_dependency = dependency)
odeprecated "'depends_on :#{dependency}'",
- "'depends_on \"#{new_dependency}\"#{tags_string}'"
+ "'depends_on \"#{new_dependency}\"'"
end
end
diff --git a/Library/Homebrew/compat/extend/string.rb b/Library/Homebrew/compat/extend/string.rb
index 6069a6bec..9d1f66557 100644
--- a/Library/Homebrew/compat/extend/string.rb
+++ b/Library/Homebrew/compat/extend/string.rb
@@ -1,5 +1,6 @@
class String
def undent
+ odeprecated "<<-EOS.undent", "<<~EOS"
gsub(/^[ \t]{#{(slice(/^[ \t]+/) || '').length}}/, "")
end
alias unindent undent
diff --git a/Library/Homebrew/compat/fails_with_llvm.rb b/Library/Homebrew/compat/fails_with_llvm.rb
index 4e8b94b03..47bda4e0b 100644
--- a/Library/Homebrew/compat/fails_with_llvm.rb
+++ b/Library/Homebrew/compat/fails_with_llvm.rb
@@ -1,9 +1,9 @@
class Formula
def fails_with_llvm(_msg = nil, _data = nil)
- odeprecated "Formula#fails_with_llvm in install"
+ odisabled "Formula#fails_with_llvm in install"
end
def self.fails_with_llvm(_msg = nil, _data = {})
- odeprecated "Formula.fails_with_llvm"
+ odisabled "Formula.fails_with_llvm"
end
end
diff --git a/Library/Homebrew/compat/formula.rb b/Library/Homebrew/compat/formula.rb
index 57ab84a76..6f740710d 100644
--- a/Library/Homebrew/compat/formula.rb
+++ b/Library/Homebrew/compat/formula.rb
@@ -1,12 +1,10 @@
module FormulaCompat
def x11_installed?
- odeprecated "Formula#x11_installed?", "MacOS::X11.installed?"
- MacOS::X11.installed?
+ odisabled "Formula#x11_installed?", "MacOS::X11.installed?"
end
def snow_leopard_64?
- odeprecated "Formula#snow_leopard_64?", "MacOS.prefer_64_bit?"
- MacOS.prefer_64_bit?
+ odisabled "Formula#snow_leopard_64?", "MacOS.prefer_64_bit?"
end
end
@@ -15,48 +13,40 @@ class Formula
extend FormulaCompat
def std_cmake_parameters
- odeprecated "Formula#std_cmake_parameters", "Formula#std_cmake_args"
- "-DCMAKE_INSTALL_PREFIX='#{prefix}' -DCMAKE_BUILD_TYPE=None -DCMAKE_FIND_FRAMEWORK=LAST -Wno-dev"
+ odisabled "Formula#std_cmake_parameters", "Formula#std_cmake_args"
end
- def cxxstdlib_check(check_type)
- odeprecated "Formula#cxxstdlib_check in install",
- "Formula.cxxstdlib_check outside install"
- self.class.cxxstdlib_check check_type
+ def cxxstdlib_check(_)
+ odisabled "Formula#cxxstdlib_check in install",
+ "Formula.cxxstdlib_check outside install"
end
def self.bottle_sha1(*)
- odeprecated "Formula.bottle_sha1"
+ odisabled "Formula.bottle_sha1"
end
def self.all
- odeprecated "Formula.all", "Formula.map"
- map
+ odisabled "Formula.all", "Formula.map"
end
- def self.canonical_name(name)
- odeprecated "Formula.canonical_name", "Formulary.canonical_name"
- Formulary.canonical_name(name)
+ def self.canonical_name(_)
+ odisabled "Formula.canonical_name", "Formulary.canonical_name"
end
- def self.class_s(name)
- odeprecated "Formula.class_s", "Formulary.class_s"
- Formulary.class_s(name)
+ def self.class_s(_)
+ odisabled "Formula.class_s", "Formulary.class_s"
end
- def self.factory(name)
- odeprecated "Formula.factory", "Formulary.factory"
- Formulary.factory(name)
+ def self.factory(_)
+ odisabled "Formula.factory", "Formulary.factory"
end
def self.require_universal_deps
- odeprecated "Formula.require_universal_deps"
- define_method(:require_universal_deps?) { true }
+ odisabled "Formula.require_universal_deps"
end
- def self.path(name)
- odeprecated "Formula.path", "Formulary.core_path"
- Formulary.core_path(name)
+ def self.path(_)
+ odisabled "Formula.path", "Formulary.core_path"
end
DATA = :DATA
@@ -67,20 +57,18 @@ class Formula
{}
end
- def python(_options = {}, &_block)
- odeprecated "Formula#python"
- yield if block_given?
- PythonRequirement.new
+ def python(_options = {}, &_)
+ odisabled "Formula#python"
end
alias python2 python
alias python3 python
def startup_plist
- odeprecated "Formula#startup_plist", "Formula#plist"
+ odisabled "Formula#startup_plist", "Formula#plist"
end
def rake(*args)
- # odeprecated "FileUtils#rake", "system \"rake\""
+ odeprecated "FileUtils#rake", "system \"rake\""
system "rake", *args
end
end
diff --git a/Library/Homebrew/compat/formula_specialties.rb b/Library/Homebrew/compat/formula_specialties.rb
index 3f8102575..bc4d20bea 100644
--- a/Library/Homebrew/compat/formula_specialties.rb
+++ b/Library/Homebrew/compat/formula_specialties.rb
@@ -1,47 +1,23 @@
class ScriptFileFormula < Formula
def install
- odeprecated "ScriptFileFormula#install", "Formula#install"
- bin.install Dir["*"]
+ odisabled "ScriptFileFormula#install", "Formula#install"
end
end
class GithubGistFormula < ScriptFileFormula
- def self.url(val)
- odeprecated "GithubGistFormula.url", "Formula.url"
- super
- version File.basename(File.dirname(val))[0, 6]
+ def self.url(_val)
+ odisabled "GithubGistFormula.url", "Formula.url"
end
end
-# This formula serves as the base class for several very similar
-# formulae for Amazon Web Services related tools.
class AmazonWebServicesFormula < Formula
- # Use this method to perform a standard install for Java-based tools,
- # keeping the .jars out of HOMEBREW_PREFIX/lib
def install
- odeprecated "AmazonWebServicesFormula#install", "Formula#install"
-
- rm Dir["bin/*.cmd"] # Remove Windows versions
- libexec.install Dir["*"]
- bin.install_symlink Dir["#{libexec}/bin/*"] - ["#{libexec}/bin/service"]
+ odisabled "AmazonWebServicesFormula#install", "Formula#install"
end
alias standard_install install
# Use this method to generate standard caveats.
- def standard_instructions(home_name, home_value = libexec)
- odeprecated "AmazonWebServicesFormula#standard_instructions", "Formula#caveats"
-
- <<~EOS
- Before you can use these tools you must export some variables to your $SHELL.
-
- To export the needed variables, add them to your dotfiles.
- * On Bash, add them to `~/.bash_profile`.
- * On Zsh, add them to `~/.zprofile` instead.
-
- export JAVA_HOME="$(/usr/libexec/java_home)"
- export AWS_ACCESS_KEY="<Your AWS Access ID>"
- export AWS_SECRET_KEY="<Your AWS Secret Key>"
- export #{home_name}="#{home_value}"
- EOS
+ def standard_instructions(_, _)
+ odisabled "AmazonWebServicesFormula#standard_instructions", "Formula#caveats"
end
end
diff --git a/Library/Homebrew/compat/formula_support.rb b/Library/Homebrew/compat/formula_support.rb
new file mode 100644
index 000000000..f56a4909b
--- /dev/null
+++ b/Library/Homebrew/compat/formula_support.rb
@@ -0,0 +1,18 @@
+require "formula_support"
+
+class KegOnlyReason
+ alias _to_s to_s
+
+ def to_s
+ 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
+
+ _to_s
+ end
+end
diff --git a/Library/Homebrew/compat/global.rb b/Library/Homebrew/compat/global.rb
index 82c452cc0..9c8f0624c 100644
--- a/Library/Homebrew/compat/global.rb
+++ b/Library/Homebrew/compat/global.rb
@@ -3,8 +3,7 @@ module Homebrew
def method_missing(method, *args, &block)
if instance_methods.include?(method)
- odeprecated "#{self}##{method}", "'module_function' or 'def self.#{method}' to convert it to a class method"
- return instance_method(method).bind(self).call(*args, &block)
+ odisabled "#{self}##{method}", "'module_function' or 'def self.#{method}' to convert it to a class method"
end
super
end
diff --git a/Library/Homebrew/compat/gpg.rb b/Library/Homebrew/compat/gpg.rb
index 01880f71e..e802d939c 100644
--- a/Library/Homebrew/compat/gpg.rb
+++ b/Library/Homebrew/compat/gpg.rb
@@ -4,46 +4,24 @@ module Gpg
module_function
def executable
+ odeprecated "Gpg.executable", 'which "gpg"'
which "gpg"
end
def available?
+ odeprecated "Gpg.available?", 'which "gpg"'
File.executable?(executable.to_s)
end
- def create_test_key(path)
- odie "No GPG present to test against!" unless available?
-
- (path/"batch.gpg").write <<~EOS
- Key-Type: RSA
- Key-Length: 2048
- Subkey-Type: RSA
- Subkey-Length: 2048
- Name-Real: Testing
- Name-Email: testing@foo.bar
- Expire-Date: 1d
- %no-protection
- %commit
- EOS
- system executable, "--batch", "--gen-key", "batch.gpg"
+ def create_test_key(_)
+ odeprecated "Gpg.create_test_key"
end
def cleanup_test_processes!
- odie "No GPG present to test against!" unless available?
-
- gpgconf = Pathname.new(executable).parent/"gpgconf"
-
- system gpgconf, "--kill", "gpg-agent"
- system gpgconf, "--homedir", "keyrings/live", "--kill",
- "gpg-agent"
+ odeprecated "Gpg.cleanup_test_processes!"
end
- def test(path)
- create_test_key(path)
- begin
- yield
- ensure
- cleanup_test_processes!
- end
+ def test(_)
+ odeprecated "Gpg.test"
end
end
diff --git a/Library/Homebrew/compat/hardware.rb b/Library/Homebrew/compat/hardware.rb
index 07a63f048..28bc79c60 100644
--- a/Library/Homebrew/compat/hardware.rb
+++ b/Library/Homebrew/compat/hardware.rb
@@ -1,43 +1,35 @@
module Hardware
class << self
def is_32_bit?
- odeprecated "Hardware.is_32_bit?", "Hardware::CPU.is_32_bit?"
- !CPU.is_64_bit?
+ odisabled "Hardware.is_32_bit?", "Hardware::CPU.is_32_bit?"
end
def is_64_bit?
- odeprecated "Hardware.is_64_bit?", "Hardware::CPU.is_64_bit?"
- CPU.is_64_bit?
+ odisabled "Hardware.is_64_bit?", "Hardware::CPU.is_64_bit?"
end
def bits
- odeprecated "Hardware.bits", "Hardware::CPU.bits"
- Hardware::CPU.bits
+ odisabled "Hardware.bits", "Hardware::CPU.bits"
end
def cpu_type
- odeprecated "Hardware.cpu_type", "Hardware::CPU.type"
- Hardware::CPU.type
+ odisabled "Hardware.cpu_type", "Hardware::CPU.type"
end
def cpu_family
- odeprecated "Hardware.cpu_family", "Hardware::CPU.family"
- Hardware::CPU.family
+ odisabled "Hardware.cpu_family", "Hardware::CPU.family"
end
def intel_family
- odeprecated "Hardware.intel_family", "Hardware::CPU.family"
- Hardware::CPU.family
+ odisabled "Hardware.intel_family", "Hardware::CPU.family"
end
def ppc_family
- odeprecated "Hardware.ppc_family", "Hardware::CPU.family"
- Hardware::CPU.family
+ odisabled "Hardware.ppc_family", "Hardware::CPU.family"
end
def processor_count
- odeprecated "Hardware.processor_count", "Hardware::CPU.cores"
- Hardware::CPU.cores
+ odisabled "Hardware.processor_count", "Hardware::CPU.cores"
end
end
end
diff --git a/Library/Homebrew/compat/json.rb b/Library/Homebrew/compat/json.rb
index c8bf1c292..18763b8a6 100644
--- a/Library/Homebrew/compat/json.rb
+++ b/Library/Homebrew/compat/json.rb
@@ -4,34 +4,16 @@ module Utils
module JSON
module_function
- Error = Class.new(StandardError)
-
- def load(str)
- odeprecated "Utils::JSON.load", "JSON.parse"
- ::JSON.parse(str)
- rescue ::JSON::ParserError => e
- raise Error, e.message
+ def load(_)
+ odisabled "Utils::JSON.load", "JSON.parse"
end
- def dump(obj)
- odeprecated "Utils::JSON.dump", "JSON.generate"
- ::JSON.generate(obj)
+ def dump(_)
+ odisabled "Utils::JSON.dump", "JSON.generate"
end
- def stringify_keys(obj)
- odeprecated "Utils::JSON.stringify_keys"
- case obj
- when Array
- obj.map { |val| stringify_keys(val) }
- when Hash
- obj.inject({}) do |result, (key, val)|
- key = key.respond_to?(:to_s) ? key.to_s : key
- val = stringify_keys(val)
- result.merge!(key => val)
- end
- else
- obj
- end
+ def stringify_keys(_)
+ odisabled "Utils::JSON.stringify_keys"
end
end
end
diff --git a/Library/Homebrew/compat/keg.rb b/Library/Homebrew/compat/keg.rb
index 8f5606d09..81e1cf0b3 100644
--- a/Library/Homebrew/compat/keg.rb
+++ b/Library/Homebrew/compat/keg.rb
@@ -1,6 +1,5 @@
class Keg
def fname
- odeprecated "Keg#fname", "Keg#name"
- name
+ odisabled "Keg#fname", "Keg#name"
end
end
diff --git a/Library/Homebrew/compat/language/haskell.rb b/Library/Homebrew/compat/language/haskell.rb
index cef97d818..8e5059874 100644
--- a/Library/Homebrew/compat/language/haskell.rb
+++ b/Library/Homebrew/compat/language/haskell.rb
@@ -2,8 +2,7 @@ module Language
module Haskell
module Cabal
def cabal_clean_lib
- odeprecated "Language::Haskell::Cabal#cabal_clean_lib"
- rm_rf lib
+ odisabled "Language::Haskell::Cabal#cabal_clean_lib"
end
end
end
diff --git a/Library/Homebrew/compat/macos.rb b/Library/Homebrew/compat/macos.rb
index 1f2c651c5..879af8357 100644
--- a/Library/Homebrew/compat/macos.rb
+++ b/Library/Homebrew/compat/macos.rb
@@ -10,142 +10,115 @@ module OS
module_function
def xcode_folder
- odeprecated "MacOS.xcode_folder", "MacOS::Xcode.folder"
- Xcode.folder
+ odisabled "MacOS.xcode_folder", "MacOS::Xcode.folder"
end
def xcode_prefix
- odeprecated "MacOS.xcode_prefix", "MacOS::Xcode.prefix"
- Xcode.prefix
+ odisabled "MacOS.xcode_prefix", "MacOS::Xcode.prefix"
end
def xcode_installed?
- odeprecated "MacOS.xcode_installed?", "MacOS::Xcode.installed?"
- Xcode.installed?
+ odisabled "MacOS.xcode_installed?", "MacOS::Xcode.installed?"
end
def xcode_version
- odeprecated "MacOS.xcode_version", "MacOS::Xcode.version"
- Xcode.version
+ odisabled "MacOS.xcode_version", "MacOS::Xcode.version"
end
def clt_installed?
- odeprecated "MacOS.clt_installed?", "MacOS::CLT.installed?"
- CLT.installed?
+ odisabled "MacOS.clt_installed?", "MacOS::CLT.installed?"
end
def clt_version?
- odeprecated "MacOS.clt_version?", "MacOS::CLT.version"
- CLT.version
+ odisabled "MacOS.clt_version?", "MacOS::CLT.version"
end
def x11_installed?
- odeprecated "MacOS.x11_installed?", "MacOS::X11.installed?"
- X11.installed?
+ odisabled "MacOS.x11_installed?", "MacOS::X11.installed?"
end
def x11_prefix
- odeprecated "MacOS.x11_prefix", "MacOS::X11.prefix"
- X11.prefix
+ odisabled "MacOS.x11_prefix", "MacOS::X11.prefix"
end
def leopard?
- odeprecated "MacOS.leopard?", "'MacOS.version == :leopard'"
- version == :leopard
+ odisabled "MacOS.leopard?", "'MacOS.version == :leopard'"
end
def snow_leopard?
- odeprecated "MacOS.snow_leopard?", "'MacOS.version >= :snow_leopard'"
- version >= :snow_leopard
+ odisabled "MacOS.snow_leopard?", "'MacOS.version >= :snow_leopard'"
end
def snow_leopard_or_newer?
- odeprecated "MacOS.snow_leopard_or_newer?", "'MacOS.version >= :snow_leopard'"
- version >= :snow_leopard
+ odisabled "MacOS.snow_leopard_or_newer?", "'MacOS.version >= :snow_leopard'"
end
def lion?
- odeprecated "MacOS.lion?", "'MacOS.version >= :lion'"
- version >= :lion
+ odisabled "MacOS.lion?", "'MacOS.version >= :lion'"
end
def lion_or_newer?
- odeprecated "MacOS.lion_or_newer?", "'MacOS.version >= :lion'"
- version >= :lion
+ odisabled "MacOS.lion_or_newer?", "'MacOS.version >= :lion'"
end
def mountain_lion?
- odeprecated "MacOS.mountain_lion?", "'MacOS.version >= :mountain_lion'"
- version >= :mountain_lion
+ odisabled "MacOS.mountain_lion?", "'MacOS.version >= :mountain_lion'"
end
def mountain_lion_or_newer?
- odeprecated "MacOS.mountain_lion_or_newer?", "'MacOS.version >= :mountain_lion'"
- version >= :mountain_lion
+ odisabled "MacOS.mountain_lion_or_newer?", "'MacOS.version >= :mountain_lion'"
end
def macports_or_fink_installed?
- odeprecated "MacOS.macports_or_fink_installed?", "!MacOS.macports_or_fink.empty?"
- !macports_or_fink.empty?
+ odisabled "MacOS.macports_or_fink_installed?", "!MacOS.macports_or_fink.empty?"
end
- def locate(tool)
- odeprecated "MacOS.locate", "DevelopmentTools.locate"
- DevelopmentTools.locate(tool)
+ def locate(_)
+ odisabled "MacOS.locate", "DevelopmentTools.locate"
end
def default_cc
- odeprecated "MacOS.default_cc", "DevelopmentTools.default_cc"
- DevelopmentTools.default_cc
+ odisabled "MacOS.default_cc", "DevelopmentTools.default_cc"
end
def default_compiler
- odeprecated "MacOS.default_compiler", "DevelopmentTools.default_compiler"
- DevelopmentTools.default_compiler
+ odisabled "MacOS.default_compiler", "DevelopmentTools.default_compiler"
end
def gcc_40_build_version
- odeprecated "MacOS.gcc_40_build_version", "DevelopmentTools.gcc_4_0_build_version"
- DevelopmentTools.gcc_4_0_build_version
+ odisabled "MacOS.gcc_40_build_version", "DevelopmentTools.gcc_4_0_build_version"
end
def gcc_4_0_build_version
- odeprecated "MacOS.gcc_4_0_build_version", "DevelopmentTools.gcc_4_0_build_version"
- DevelopmentTools.gcc_4_0_build_version
+ odisabled "MacOS.gcc_4_0_build_version", "DevelopmentTools.gcc_4_0_build_version"
end
def gcc_42_build_version
- odeprecated "MacOS.gcc_42_build_version", "DevelopmentTools.gcc_4_2_build_version"
- DevelopmentTools.gcc_4_2_build_version
+ odisabled "MacOS.gcc_42_build_version", "DevelopmentTools.gcc_4_2_build_version"
end
def gcc_build_version
- odeprecated "MacOS.gcc_build_version", "DevelopmentTools.gcc_4_2_build_version"
- DevelopmentTools.gcc_4_2_build_version
+ odisabled "MacOS.gcc_build_version", "DevelopmentTools.gcc_4_2_build_version"
end
def llvm_build_version
- odeprecated "MacOS.llvm_build_version"
+ odisabled "MacOS.llvm_build_version"
end
def clang_version
- odeprecated "MacOS.clang_version", "DevelopmentTools.clang_version"
- DevelopmentTools.clang_version
+ odisabled "MacOS.clang_version", "DevelopmentTools.clang_version"
end
def clang_build_version
- odeprecated "MacOS.clang_build_version", "DevelopmentTools.clang_build_version"
- DevelopmentTools.clang_build_version
+ odisabled "MacOS.clang_build_version", "DevelopmentTools.clang_build_version"
end
def has_apple_developer_tools?
- odeprecated "MacOS.has_apple_developer_tools?", "DevelopmentTools.installed?"
- DevelopmentTools.installed?
+ odisabled "MacOS.has_apple_developer_tools?", "DevelopmentTools.installed?"
end
def release
- odeprecated "MacOS.release", "MacOS.version"
- version
+ odisabled "MacOS.release", "MacOS.version"
end
end
end
diff --git a/Library/Homebrew/compat/pathname.rb b/Library/Homebrew/compat/pathname.rb
index 58888f017..df4b261a9 100644
--- a/Library/Homebrew/compat/pathname.rb
+++ b/Library/Homebrew/compat/pathname.rb
@@ -1,17 +1,9 @@
class Pathname
- def cp(dst)
- odeprecated "Pathname#cp", "FileUtils.cp"
- if file?
- FileUtils.cp to_s, dst
- else
- FileUtils.cp_r to_s, dst
- end
- dst
+ def cp(_)
+ odisabled "Pathname#cp", "FileUtils.cp"
end
- def chmod_R(perms)
- odeprecated "Pathname#chmod_R", "FileUtils.chmod_R"
- require "fileutils"
- FileUtils.chmod_R perms, to_s
+ def chmod_R(_)
+ odisabled "Pathname#chmod_R", "FileUtils.chmod_R"
end
end
diff --git a/Library/Homebrew/compat/requirements.rb b/Library/Homebrew/compat/requirements.rb
index 304dd2504..bffc5f5f1 100644
--- a/Library/Homebrew/compat/requirements.rb
+++ b/Library/Homebrew/compat/requirements.rb
@@ -1,76 +1,134 @@
require "requirements"
-require "compat/requirements/emacs_requirement"
-require "compat/requirements/fortran_requirement"
require "compat/requirements/language_module_requirement"
-require "compat/requirements/mpi_requirement"
-require "compat/requirements/perl_requirement"
-require "compat/requirements/python_requirement"
-require "compat/requirements/ruby_requirement"
-require "compat/requirements/tex_requirement"
-class MysqlRequirement < Requirement
+class CVSRequirement < Requirement
fatal true
- default_formula "mysql"
- satisfy { which "mysql_config" }
+ satisfy do
+ odeprecated("CVSRequirement", "'depends_on \"cvs\"'")
+ which "cvs"
+ end
end
-class PostgresqlRequirement < Requirement
+class EmacsRequirement < Requirement
fatal true
- default_formula "postgresql"
- satisfy { which "pg_config" }
+ satisfy do
+ odeprecated("EmacsRequirement", "'depends_on \"cvs\"'")
+ which "emacs"
+ end
end
-class RbenvRequirement < Requirement
+class FortranRequirement < Requirement
fatal true
- default_formula "rbenv"
- satisfy { which "rbenv" }
+ satisfy do
+ odeprecated("FortranRequirement", "'depends_on \"cvs\"'")
+ which "gfortran"
+ end
end
-class CVSRequirement < Requirement
+class GitRequirement < Requirement
+ fatal true
+ satisfy do
+ odeprecated("GitRequirement", "'depends_on \"cvs\"'")
+ which "git"
+ end
+end
+
+class GPG2Requirement < Requirement
fatal true
- default_formula "cvs"
- satisfy { which "cvs" }
+ satisfy do
+ odeprecated("GPG2Requirement", "'depends_on \"cvs\"'")
+ which "gpg"
+ end
end
class MercurialRequirement < Requirement
fatal true
- default_formula "mercurial"
- satisfy { which "hg" }
+ satisfy do
+ odeprecated("MercurialRequirement", "'depends_on \"cvs\"'")
+ which "hg"
+ end
end
-class GPG2Requirement < Requirement
+class MPIRequirement < Requirement
fatal true
- default_formula "gnupg"
- satisfy { which "gpg" }
+ satisfy do
+ odeprecated("MPIRequirement", "'depends_on \"cvs\"'")
+ which "mpicc"
+ end
end
-class GitRequirement < Requirement
+class MysqlRequirement < Requirement
+ fatal true
+ satisfy do
+ odeprecated("MysqlRequirement", "'depends_on \"cvs\"'")
+ which "mysql_config"
+ end
+end
+
+class PerlRequirement < Requirement
+ fatal true
+ satisfy do
+ odeprecated("PerlRequirement", "'depends_on \"cvs\"'")
+ which "perl"
+ end
+end
+
+class PostgresqlRequirement < Requirement
+ fatal true
+ satisfy do
+ odeprecated("PostgresqlRequirement", "'depends_on \"cvs\"'")
+ which "pg_config"
+ end
+end
+
+class PythonRequirement < Requirement
+ fatal true
+ satisfy do
+ odeprecated("PythonRequirement", "'depends_on \"cvs\"'")
+ which "python"
+ end
+end
+
+class Python3Requirement < Requirement
fatal true
- default_formula "git"
- satisfy { Utils.git_available? }
+ satisfy do
+ odeprecated("Python3Requirement", "'depends_on \"cvs\"'")
+ which "python3"
+ end
+end
+
+class RbenvRequirement < Requirement
+ fatal true
+ satisfy do
+ odeprecated("RbenvRequirement", "'depends_on \"cvs\"'")
+ which "rbenv"
+ end
+end
+
+class RubyRequirement < Requirement
+ fatal true
+ satisfy do
+ odeprecated("RubyRequirement", "'depends_on \"cvs\"'")
+ which "ruby"
+ end
end
class SubversionRequirement < Requirement
fatal true
- default_formula "subversion"
- satisfy { Utils.svn_available? }
-end
-
-XcodeDependency = XcodeRequirement
-MysqlDependency = MysqlRequirement
-PostgresqlDependency = PostgresqlRequirement
-GPGDependency = GPG2Requirement
-GPGRequirement = GPG2Requirement
-TeXDependency = TeXRequirement
-MercurialDependency = MercurialRequirement
-GitDependency = GitRequirement
-FortranDependency = FortranRequirement
-JavaDependency = JavaRequirement
-LanguageModuleDependency = LanguageModuleRequirement
-MPIDependency = MPIRequirement
-OsxfuseDependency = OsxfuseRequirement
-PythonDependency = PythonRequirement
-TuntapDependency = TuntapRequirement
-X11Dependency = X11Requirement
-ConflictsWithBinaryOsxfuse = NonBinaryOsxfuseRequirement
-MinimumMacOSRequirement = MacOSRequirement
+ satisfy do
+ odeprecated("SubversionRequirement", "'depends_on \"cvs\"'")
+ which "svn"
+ end
+end
+
+class TeXRequirement < Requirement
+ fatal true
+ cask "mactex"
+ download "https://www.tug.org/mactex/"
+ satisfy do
+ odeprecated("TeXRequirement", "'depends_on \"cvs\"'")
+ which("tex") || which("latex")
+ end
+end
+
+MinimumMacOSRequirement = MacOSRequirement
diff --git a/Library/Homebrew/compat/requirements/emacs_requirement.rb b/Library/Homebrew/compat/requirements/emacs_requirement.rb
deleted file mode 100644
index c8e2ec274..000000000
--- a/Library/Homebrew/compat/requirements/emacs_requirement.rb
+++ /dev/null
@@ -1,35 +0,0 @@
-class EmacsRequirement < Requirement
- fatal true
- default_formula "emacs"
-
- def initialize(tags)
- @version = tags.shift if /\d+\.*\d*/ =~ tags.first
- super
- end
-
- satisfy build_env: false do
- next false unless which "emacs"
- next true unless @version
- emacs_version = Utils.popen_read("emacs", "--batch", "--eval", "(princ emacs-version)")
- Version.create(emacs_version) >= Version.create(@version)
- end
-
- env do
- ENV.prepend_path "PATH", which("emacs").dirname
- ENV["EMACS"] = "emacs"
- end
-
- def message
- if @version
- s = "Emacs #{@version} or later is required."
- else
- s = "Emacs is required."
- end
- s += super
- s
- end
-
- def inspect
- "#<#{self.class.name}: #{name.inspect} #{tags.inspect} version=#{@version.inspect}>"
- end
-end
diff --git a/Library/Homebrew/compat/requirements/fortran_requirement.rb b/Library/Homebrew/compat/requirements/fortran_requirement.rb
deleted file mode 100644
index ba3fead6f..000000000
--- a/Library/Homebrew/compat/requirements/fortran_requirement.rb
+++ /dev/null
@@ -1,13 +0,0 @@
-require "requirement"
-
-class FortranRequirement < Requirement
- fatal true
-
- default_formula "gcc"
-
- env { ENV.fortran }
-
- satisfy build_env: false do
- which(ENV["FC"] || "gfortran")
- end
-end
diff --git a/Library/Homebrew/compat/requirements/mpi_requirement.rb b/Library/Homebrew/compat/requirements/mpi_requirement.rb
deleted file mode 100644
index 065b56c8b..000000000
--- a/Library/Homebrew/compat/requirements/mpi_requirement.rb
+++ /dev/null
@@ -1,66 +0,0 @@
-require "requirement"
-
-# There are multiple implementations of MPI-2 available.
-# http://www.mpi-forum.org/
-# This requirement is used to find an appropriate one.
-class MPIRequirement < Requirement
- attr_reader :lang_list
-
- fatal true
-
- default_formula "open-mpi"
-
- env :userpaths
-
- # This method must accept varargs rather than an array for
- # backwards compatibility with formulae that call it directly.
- def initialize(*tags)
- @non_functional = []
- @unknown_langs = []
- @lang_list = [:cc, :cxx, :f77, :f90] & tags
- tags -= @lang_list
- super(tags)
- end
-
- def mpi_wrapper_works?(compiler)
- compiler = which compiler
- return false if compiler.nil? || !compiler.executable?
-
- # Some wrappers are non-functional and will return a non-zero exit code
- # when invoked for version info.
- #
- # NOTE: A better test may be to do a small test compilation a la autotools.
- quiet_system compiler, "--version"
- end
-
- def inspect
- "#<#{self.class.name}: #{name.inspect} #{tags.inspect} lang_list=#{@lang_list.inspect}>"
- end
-
- satisfy do
- @lang_list.each do |lang|
- case lang
- when :cc, :cxx, :f90, :f77
- compiler = "mpi" + lang.to_s
- @non_functional << compiler unless mpi_wrapper_works? compiler
- else
- @unknown_langs << lang.to_s
- end
- end
- @unknown_langs.empty? && @non_functional.empty?
- end
-
- env do
- # Set environment variables to help configure scripts find MPI compilers.
- # Variable names taken from:
- # https://www.gnu.org/software/autoconf-archive/ax_mpi.html
- @lang_list.each do |lang|
- compiler = "mpi" + lang.to_s
- mpi_path = which compiler
-
- # Fortran 90 environment var has a different name
- compiler = "MPIFC" if lang == :f90
- ENV[compiler.upcase] = mpi_path
- end
- end
-end
diff --git a/Library/Homebrew/compat/requirements/perl_requirement.rb b/Library/Homebrew/compat/requirements/perl_requirement.rb
deleted file mode 100644
index 70eb2a36c..000000000
--- a/Library/Homebrew/compat/requirements/perl_requirement.rb
+++ /dev/null
@@ -1,36 +0,0 @@
-class PerlRequirement < Requirement
- fatal true
- default_formula "perl"
-
- def initialize(tags)
- @version = tags.shift if /^\d+\.\d+$/ =~ tags.first
- raise "PerlRequirement requires a version!" unless @version
- super
- end
-
- satisfy(build_env: false) do
- which_all("perl").detect do |perl|
- perl_version = Utils.popen_read(perl, "--version")[/v(\d+\.\d+)(?:\.\d+)?/, 1]
- next unless perl_version
- Version.create(perl_version.to_s) >= Version.create(@version)
- end
- end
-
- def message
- s = "Perl #{@version} is required to install this formula."
- s += super
- s
- end
-
- def inspect
- "#<#{self.class.name}: #{name.inspect} #{tags.inspect} version=#{@version.inspect}>"
- end
-
- def display_s
- if @version
- "#{name} >= #{@version}"
- else
- name
- end
- end
-end
diff --git a/Library/Homebrew/compat/requirements/python_requirement.rb b/Library/Homebrew/compat/requirements/python_requirement.rb
deleted file mode 100644
index 3215d0a6c..000000000
--- a/Library/Homebrew/compat/requirements/python_requirement.rb
+++ /dev/null
@@ -1,68 +0,0 @@
-require "language/python"
-
-class PythonRequirement < Requirement
- fatal true
- default_formula "python"
-
- satisfy build_env: false do
- python = which_python
- next unless python
- next unless short_version
- # Always use Python 2.7 for consistency on older versions of Mac OS X.
- short_version == Version.create("2.7")
- end
-
- env do
- if !system_python? && short_version == Version.create("2.7")
- ENV.prepend_path "PATH", which_python.dirname
- end
-
- # Homebrew Python should take precedence over other Pythons in the PATH
- ENV.prepend_path "PATH", Formula["python"].opt_bin
- ENV.prepend_path "PATH", Formula["python"].opt_libexec/"bin"
-
- if system_python?
- ENV["PYTHONPATH"] = "#{HOMEBREW_PREFIX}/lib/python#{short_version}/site-packages"
- end
- end
-
- private
-
- def short_version
- @short_version ||= Language::Python.major_minor_version which_python
- end
-
- def which_python
- python = which python_binary
- return unless python
- Pathname.new Utils.popen_read(python, "-c", "import sys; print(sys.executable)").strip
- end
-
- def system_python
- "/usr/bin/#{python_binary}"
- end
-
- def system_python?
- system_python == which_python.to_s
- end
-
- def python_binary
- "python2.7"
- end
-
- # Deprecated
- alias to_s python_binary
-end
-
-class Python3Requirement < PythonRequirement
- fatal true
- default_formula "python3"
-
- satisfy(build_env: false) { which_python }
-
- private
-
- def python_binary
- "python3"
- end
-end
diff --git a/Library/Homebrew/compat/requirements/ruby_requirement.rb b/Library/Homebrew/compat/requirements/ruby_requirement.rb
deleted file mode 100644
index a9ec8c42d..000000000
--- a/Library/Homebrew/compat/requirements/ruby_requirement.rb
+++ /dev/null
@@ -1,56 +0,0 @@
-class RubyRequirement < Requirement
- fatal true
- default_formula "ruby"
-
- def initialize(tags)
- @version = tags.shift if /(\d\.)+\d/ =~ tags.first
- raise "RubyRequirement requires a version!" unless @version
- super
- end
-
- satisfy(build_env: false) { new_enough_ruby }
-
- env do
- ENV.prepend_path "PATH", new_enough_ruby.dirname
- end
-
- def message
- s = "Ruby >= #{@version} is required to install this formula."
- s += super
- s
- end
-
- def inspect
- "#<#{self.class.name}: #{name.inspect} #{tags.inspect} version=#{@version.inspect}>"
- end
-
- def display_s
- if @version
- "#{name} >= #{@version}"
- else
- name
- end
- end
-
- private
-
- def new_enough_ruby
- rubies.detect { |ruby| new_enough?(ruby) }
- end
-
- def rubies
- rubies = which_all("ruby")
- ruby_formula = Formula["ruby"]
- rubies.unshift ruby_formula.bin/"ruby" if ruby_formula&.installed?
- rubies.uniq
- end
-
- def new_enough?(ruby)
- version = Utils.popen_read(ruby, "-e", "print RUBY_VERSION").strip
- version =~ /^\d+\.\d+/ && Version.create(version) >= min_version
- end
-
- def min_version
- @min_version ||= Version.create(@version)
- end
-end
diff --git a/Library/Homebrew/compat/requirements/tex_requirement.rb b/Library/Homebrew/compat/requirements/tex_requirement.rb
deleted file mode 100644
index cb26a8477..000000000
--- a/Library/Homebrew/compat/requirements/tex_requirement.rb
+++ /dev/null
@@ -1,20 +0,0 @@
-require "requirement"
-
-class TeXRequirement < Requirement
- fatal true
- cask "mactex"
- download "https://www.tug.org/mactex/"
-
- satisfy { which("tex") || which("latex") }
-
- def message
- s = <<~EOS
- A LaTeX distribution is required for Homebrew to install this formula.
-
- Make sure that "/usr/texbin", or the location you installed it to, is in
- your PATH before proceeding.
- EOS
- s += super
- s
- end
-end
diff --git a/Library/Homebrew/compat/software_spec.rb b/Library/Homebrew/compat/software_spec.rb
index 8b0408d02..814c00fa8 100644
--- a/Library/Homebrew/compat/software_spec.rb
+++ b/Library/Homebrew/compat/software_spec.rb
@@ -1,6 +1,5 @@
class BottleSpecification
- def revision(*args)
- odeprecated "BottleSpecification.revision", "BottleSpecification.rebuild"
- rebuild(*args)
+ def revision(*)
+ odisabled "BottleSpecification.revision", "BottleSpecification.rebuild"
end
end
diff --git a/Library/Homebrew/compat/tab.rb b/Library/Homebrew/compat/tab.rb
index 2cf71c923..651bcf1e1 100644
--- a/Library/Homebrew/compat/tab.rb
+++ b/Library/Homebrew/compat/tab.rb
@@ -1,6 +1,5 @@
class Tab < OpenStruct
def build_32_bit?
- odeprecated "Tab.build_32_bit?"
- include?("32-bit")
+ odisabled "Tab.build_32_bit?"
end
end
diff --git a/Library/Homebrew/compat/tap.rb b/Library/Homebrew/compat/tap.rb
index 37b1eeac1..a1e3ce172 100644
--- a/Library/Homebrew/compat/tap.rb
+++ b/Library/Homebrew/compat/tap.rb
@@ -2,7 +2,6 @@ require "tap"
class Tap
def core_formula_repository?
- odeprecated "Tap#core_formula_repository?", "Tap#core_tap?"
- core_tap?
+ odisabled "Tap#core_formula_repository?", "Tap#core_tap?"
end
end
diff --git a/Library/Homebrew/compat/utils.rb b/Library/Homebrew/compat/utils.rb
index 8904f0f2b..f83d07599 100644
--- a/Library/Homebrew/compat/utils.rb
+++ b/Library/Homebrew/compat/utils.rb
@@ -2,17 +2,14 @@ module Tty
module_function
def white
- odeprecated "Tty.white", "Tty.reset.bold"
- reset.bold
+ odisabled "Tty.white", "Tty.reset.bold"
end
end
-def puts_columns(items)
- odeprecated "puts_columns", "puts Formatter.columns"
- puts Formatter.columns(items)
+def puts_columns(_)
+ odisabled "puts_columns", "puts Formatter.columns"
end
-def plural(n, s = "s")
- odeprecated "#plural", "Formatter.pluralize"
- (n == 1) ? "" : s
+def plural(_, _)
+ odisabled "#plural", "Formatter.pluralize"
end
diff --git a/Library/Homebrew/compat/utils/shell.rb b/Library/Homebrew/compat/utils/shell.rb
index 161f10ebb..2f387d967 100644
--- a/Library/Homebrew/compat/utils/shell.rb
+++ b/Library/Homebrew/compat/utils/shell.rb
@@ -1,8 +1,7 @@
module Utils
module Shell
def self.shell_profile
- odeprecated "Utils::Shell.shell_profile", "Utils::Shell.profile"
- Utils::Shell.profile
+ odisabled "Utils::Shell.shell_profile", "Utils::Shell.profile"
end
end
end
diff --git a/Library/Homebrew/compat/version.rb b/Library/Homebrew/compat/version.rb
index 2dd089015..4a6fd7ace 100644
--- a/Library/Homebrew/compat/version.rb
+++ b/Library/Homebrew/compat/version.rb
@@ -1,6 +1,5 @@
class Version
- def slice(*args)
- odeprecated "Version#slice", "Version#to_s.slice"
- to_s.slice(*args)
+ def slice(*)
+ odisabled "Version#slice", "Version#to_s.slice"
end
end
diff --git a/Library/Homebrew/compat/xcode.rb b/Library/Homebrew/compat/xcode.rb
index 14150cc7c..f212ada64 100644
--- a/Library/Homebrew/compat/xcode.rb
+++ b/Library/Homebrew/compat/xcode.rb
@@ -4,8 +4,7 @@ module OS
module_function
def provides_autotools?
- odeprecated "OS::Mac::Xcode.provides_autotools?"
- version < "4.3"
+ odisabled "OS::Mac::Xcode.provides_autotools?"
end
end
end
diff --git a/Library/Homebrew/constants.rb b/Library/Homebrew/constants.rb
index 41274922c..9514320ab 100644
--- a/Library/Homebrew/constants.rb
+++ b/Library/Homebrew/constants.rb
@@ -1,6 +1,5 @@
# frozen_string_literal: true
# RuboCop version used for `brew style` and `brew cask style`
-HOMEBREW_RUBOCOP_VERSION = "0.51.0"
-HOMEBREW_RUBOCOP_PARSER_VERSION = "2.4.0.0" # for Ruby 2.3.3
-HOMEBREW_RUBOCOP_CASK_VERSION = "~> 0.15.1" # has to be updated when RuboCop version changes
+HOMEBREW_RUBOCOP_VERSION = "0.52.1"
+HOMEBREW_RUBOCOP_CASK_VERSION = "~> 0.16.0" # has to be updated when RuboCop version changes
diff --git a/Library/Homebrew/dev-cmd/create.rb b/Library/Homebrew/dev-cmd/create.rb
index e5481b532..122be2593 100644
--- a/Library/Homebrew/dev-cmd/create.rb
+++ b/Library/Homebrew/dev-cmd/create.rb
@@ -165,77 +165,73 @@ class FormulaCreator
path.write ERB.new(template, nil, ">").result(binding)
end
- def template; <<~EOS
- # Documentation: https://docs.brew.sh/Formula-Cookbook.html
- # http://www.rubydoc.info/github/Homebrew/brew/master/Formula
- # PLEASE REMOVE ALL GENERATED COMMENTS BEFORE SUBMITTING YOUR PULL REQUEST!
-
- class #{Formulary.class_s(name)} < Formula
- desc "#{desc}"
- homepage "#{homepage}"
- <% if head? %>
- head "#{url}"
- <% else %>
- url "#{url}"
- <% unless version.nil? or version.detected_from_url? %>
- version "#{version}"
- <% end %>
- sha256 "#{sha256}"
- <% end %>
-
- <% if mode == :cmake %>
- depends_on "cmake" => :build
- <% elsif mode == :meson %>
- depends_on "meson" => :build
- depends_on "ninja" => :build
- <% elsif mode.nil? %>
- # depends_on "cmake" => :build
- <% end %>
-
- def install
- # ENV.deparallelize # if your formula fails when building in parallel
-
- <% if mode == :cmake %>
- system "cmake", ".", *std_cmake_args
- <% elsif mode == :autotools %>
- # Remove unrecognized options if warned by configure
- system "./configure", "--disable-debug",
- "--disable-dependency-tracking",
- "--disable-silent-rules",
- "--prefix=\#{prefix}"
- <% elsif mode == :meson %>
- mkdir "build" do
- system "meson", "--prefix=\#{prefix}", ".."
- system "ninja"
- system "ninja", "test"
- system "ninja", "install"
+ def template
+ <<~EOS
+ # Documentation: https://docs.brew.sh/Formula-Cookbook.html
+ # http://www.rubydoc.info/github/Homebrew/brew/master/Formula
+ # PLEASE REMOVE ALL GENERATED COMMENTS BEFORE SUBMITTING YOUR PULL REQUEST!
+ class #{Formulary.class_s(name)} < Formula
+ desc "#{desc}"
+ homepage "#{homepage}"
+ <% if head? %>
+ head "#{url}"
+ <% else %>
+ url "#{url}"
+ <% unless version.nil? or version.detected_from_url? %>
+ version "#{version}"
+ <% end %>
+ sha256 "#{sha256}"
+ <% end %>
+ <% if mode == :cmake %>
+ depends_on "cmake" => :build
+ <% elsif mode == :meson %>
+ depends_on "meson" => :build
+ depends_on "ninja" => :build
+ <% elsif mode.nil? %>
+ # depends_on "cmake" => :build
+ <% end %>
+ def install
+ # ENV.deparallelize # if your formula fails when building in parallel
+ <% if mode == :cmake %>
+ system "cmake", ".", *std_cmake_args
+ <% elsif mode == :autotools %>
+ # Remove unrecognized options if warned by configure
+ system "./configure", "--disable-debug",
+ "--disable-dependency-tracking",
+ "--disable-silent-rules",
+ "--prefix=\#{prefix}"
+ <% elsif mode == :meson %>
+ mkdir "build" do
+ system "meson", "--prefix=\#{prefix}", ".."
+ system "ninja"
+ system "ninja", "test"
+ system "ninja", "install"
+ end
+ <% else %>
+ # Remove unrecognized options if warned by configure
+ system "./configure", "--disable-debug",
+ "--disable-dependency-tracking",
+ "--disable-silent-rules",
+ "--prefix=\#{prefix}"
+ # system "cmake", ".", *std_cmake_args
+ <% end %>
+ <% if mode != :meson %>
+ system "make", "install" # if this fails, try separate make/make install steps
+ <% end %>
+ end
+ test do
+ # `test do` will create, run in and delete a temporary directory.
+ #
+ # This test will fail and we won't accept that! For Homebrew/homebrew-core
+ # this will need to be a test that verifies the functionality of the
+ # software. Run the test with `brew test #{name}`. Options passed
+ # to `brew install` such as `--HEAD` also need to be provided to `brew test`.
+ #
+ # The installed folder is not in the path, so use the entire path to any
+ # executables being tested: `system "\#{bin}/program", "do", "something"`.
+ system "false"
end
- <% else %>
- # Remove unrecognized options if warned by configure
- system "./configure", "--disable-debug",
- "--disable-dependency-tracking",
- "--disable-silent-rules",
- "--prefix=\#{prefix}"
- # system "cmake", ".", *std_cmake_args
- <% end %>
- <% if mode != :meson %>
- system "make", "install" # if this fails, try separate make/make install steps
- <% end %>
- end
-
- test do
- # `test do` will create, run in and delete a temporary directory.
- #
- # This test will fail and we won't accept that! For Homebrew/homebrew-core
- # this will need to be a test that verifies the functionality of the
- # software. Run the test with `brew test #{name}`. Options passed
- # to `brew install` such as `--HEAD` also need to be provided to `brew test`.
- #
- # The installed folder is not in the path, so use the entire path to any
- # executables being tested: `system "\#{bin}/program", "do", "something"`.
- system "false"
end
- end
EOS
end
end
diff --git a/Library/Homebrew/dev-cmd/pull.rb b/Library/Homebrew/dev-cmd/pull.rb
index 5979d87b8..959fbd6c7 100644
--- a/Library/Homebrew/dev-cmd/pull.rb
+++ b/Library/Homebrew/dev-cmd/pull.rb
@@ -447,7 +447,7 @@ module Homebrew
def publish_bottle_file_on_bintray(f, bintray_org, creds)
repo = Utils::Bottles::Bintray.repository(f.tap)
package = Utils::Bottles::Bintray.package(f.name)
- info = FormulaInfoFromJson.lookup(f.name)
+ info = FormulaInfoFromJson.lookup(f.full_name)
if info.nil?
raise "Failed publishing bottle: failed reading formula info for #{f.full_name}"
end
diff --git a/Library/Homebrew/extend/os/linux/requirements/java_requirement.rb b/Library/Homebrew/extend/os/linux/requirements/java_requirement.rb
index 7816f6b6f..23a68743d 100644
--- a/Library/Homebrew/extend/os/linux/requirements/java_requirement.rb
+++ b/Library/Homebrew/extend/os/linux/requirements/java_requirement.rb
@@ -1,8 +1,6 @@
require "language/java"
class JavaRequirement < Requirement
- default_formula "jdk"
-
env do
env_java_common
env_oracle_jdk
diff --git a/Library/Homebrew/formula.rb b/Library/Homebrew/formula.rb
index eb499d958..ad7e28a2e 100644
--- a/Library/Homebrew/formula.rb
+++ b/Library/Homebrew/formula.rb
@@ -14,6 +14,7 @@ require "tap"
require "keg"
require "migrator"
require "extend/ENV"
+require "language/python"
# A formula provides instructions and metadata for Homebrew to install a piece
# of software. Every Homebrew formula is a {Formula}.
@@ -2188,32 +2189,24 @@ class Formula
# <pre># If a dependency is only needed in certain cases:
# depends_on "sqlite" if MacOS.version == :leopard
# depends_on :xcode # If the formula really needs full Xcode.
- # depends_on :tex # Homebrew does not provide a Tex Distribution.
- # depends_on :fortran # Checks that `gfortran` is available or `FC` is set.
- # depends_on :mpi => :cc # Needs MPI with `cc`
- # depends_on :mpi => [:cc, :cxx, :optional] # Is optional. MPI with `cc` and `cxx`.
# depends_on :macos => :lion # Needs at least OS X Lion (10.7).
- # depends_on :apr # If a formula requires the CLT-provided apr library to exist.
# depends_on :arch => :intel # If this formula only builds on Intel architecture.
# depends_on :arch => :x86_64 # If this formula only builds on Intel x86 64-bit.
# depends_on :arch => :ppc # Only builds on PowerPC?
# depends_on :ld64 # Sometimes ld fails on `MacOS.version < :leopard`. Then use this.
- # depends_on :x11 # X11/XQuartz components.
+ # depends_on :x11 => :optional # X11/XQuartz components.
# depends_on :osxfuse # Permits the use of the upstream signed binary or our source package.
# depends_on :tuntap # Does the same thing as above. This is vital for Yosemite and above.
- # depends_on :mysql => :recommended</pre>
# <pre># It is possible to only depend on something if
# # `build.with?` or `build.without? "another_formula"`:
- # depends_on :mysql # allows brewed or external mysql to be used
- # depends_on :postgresql if build.without? "sqlite"
- # depends_on :hg # Mercurial (external or brewed) is needed</pre>
+ # depends_on "postgresql" if build.without? "sqlite"
#
- # <pre># If any Python >= 2.7 < 3.x is okay (either from macOS or brewed):
- # depends_on :python</pre>
- # <pre># to depend on Python >= 2.7 but use system Python where possible
- # depends_on :python if MacOS.version <= :snow_leopard</pre>
+ # <pre># Python 2.7:
+ # depends_on "python"</pre>
+ # <pre># Python 2.7 but use system Python where possible
+ # depends_on "python" if MacOS.version <= :snow_leopard</pre>
# <pre># Python 3.x if the `--with-python3` is given to `brew install example`
- # depends_on :python3 => :optional</pre>
+ # depends_on "python3" => :optional</pre>
def depends_on(dep)
specs.each { |spec| spec.depends_on(dep) }
end
diff --git a/Library/Homebrew/formula_installer.rb b/Library/Homebrew/formula_installer.rb
index 6d4fb07bd..2105b9d71 100644
--- a/Library/Homebrew/formula_installer.rb
+++ b/Library/Homebrew/formula_installer.rb
@@ -32,11 +32,11 @@ class FormulaInstaller
attr_reader :formula
attr_accessor :options, :build_bottle, :invalid_option_names
- attr_accessor :installed_as_dependency, :installed_on_request
+ attr_accessor :installed_as_dependency, :installed_on_request, :link_keg
mode_attr_accessor :show_summary_heading, :show_header
mode_attr_accessor :build_from_source, :force_bottle
mode_attr_accessor :ignore_deps, :only_deps, :interactive, :git
- mode_attr_accessor :verbose, :debug, :quieter, :link_keg
+ mode_attr_accessor :verbose, :debug, :quieter
def initialize(formula)
@formula = formula
@@ -544,7 +544,7 @@ class FormulaInstaller
fi.verbose = verbose?
fi.quieter = quieter?
fi.debug = debug?
- fi.link_keg = keg_was_linked if keg_had_linked_keg
+ fi.link_keg ||= keg_was_linked if keg_had_linked_keg
fi.installed_as_dependency = true
fi.installed_on_request = df.any_version_installed? && tab.installed_on_request
fi.prelude
diff --git a/Library/Homebrew/formula_support.rb b/Library/Homebrew/formula_support.rb
index 53fd61db8..011d8a4b7 100644
--- a/Library/Homebrew/formula_support.rb
+++ b/Library/Homebrew/formula_support.rb
@@ -32,15 +32,25 @@ class KegOnlyReason
def to_s
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
- when :provided_by_macos, :provided_by_osx then <<~EOS
+ when :provided_by_macos then <<~EOS
macOS already provides this software and installing another version in
parallel can cause all kinds of trouble
EOS
- when :shadowed_by_macos, :shadowed_by_osx then <<~EOS
+ when :shadowed_by_macos then <<~EOS
macOS provides similar software and installing this software in
parallel can cause all kinds of trouble
EOS
diff --git a/Library/Homebrew/keg.rb b/Library/Homebrew/keg.rb
index bb9778c81..e3b93fa72 100644
--- a/Library/Homebrew/keg.rb
+++ b/Library/Homebrew/keg.rb
@@ -54,9 +54,10 @@ class Keg
end
class DirectoryNotWritableError < LinkError
- def to_s; <<~EOS
- Could not symlink #{src}
- #{dst.dirname} is not writable.
+ def to_s
+ <<~EOS
+ Could not symlink #{src}
+ #{dst.dirname} is not writable.
EOS
end
end
diff --git a/Library/Homebrew/rubocops/bottle_block_cop.rb b/Library/Homebrew/rubocops/bottle_block_cop.rb
index 77759e427..3cfde01ad 100644
--- a/Library/Homebrew/rubocops/bottle_block_cop.rb
+++ b/Library/Homebrew/rubocops/bottle_block_cop.rb
@@ -16,8 +16,6 @@ module RuboCop
problem "Use rebuild instead of revision in bottle block" if method_called_in_block?(bottle, :revision)
end
- private
-
def autocorrect(node)
lambda do |corrector|
correction = node.source.sub("revision", "rebuild")
diff --git a/Library/Homebrew/rubocops/checksum_cop.rb b/Library/Homebrew/rubocops/checksum_cop.rb
index 23a787809..4dd8ad91c 100644
--- a/Library/Homebrew/rubocops/checksum_cop.rb
+++ b/Library/Homebrew/rubocops/checksum_cop.rb
@@ -50,8 +50,6 @@ module RuboCop
end
end
- private
-
def autocorrect(node)
lambda do |corrector|
correction = node.source.downcase
diff --git a/Library/Homebrew/rubocops/class_cop.rb b/Library/Homebrew/rubocops/class_cop.rb
index dad81abfc..6f1ffc144 100644
--- a/Library/Homebrew/rubocops/class_cop.rb
+++ b/Library/Homebrew/rubocops/class_cop.rb
@@ -16,8 +16,6 @@ module RuboCop
problem "#{parent_class} is deprecated, use Formula instead"
end
- private
-
def autocorrect(node)
lambda do |corrector|
corrector.replace(node.source_range, "Formula")
diff --git a/Library/Homebrew/rubocops/components_order_cop.rb b/Library/Homebrew/rubocops/components_order_cop.rb
index 3bf2ede16..a1a576177 100644
--- a/Library/Homebrew/rubocops/components_order_cop.rb
+++ b/Library/Homebrew/rubocops/components_order_cop.rb
@@ -62,8 +62,6 @@ module RuboCop
end
end
- private
-
# Method to format message for reporting component precedence violations
def component_problem(c1, c2)
problem "`#{format_component(c1)}` (line #{line_number(c1)}) should be put before `#{format_component(c2)}` (line #{line_number(c2)})"
@@ -99,7 +97,7 @@ module RuboCop
line_breaks = (order_idx > 8) ? "\n\n" : "\n"
corrector.insert_before(node2.source_range, node1.source + line_breaks + indentation)
end
- corrector.remove(range_with_surrounding_space(node1.source_range, :left))
+ corrector.remove(range_with_surrounding_space(range: node1.source_range, side: :left))
end
# Returns precedence index and component's index to properly reorder and group during autocorrect
diff --git a/Library/Homebrew/rubocops/extend/formula_cop.rb b/Library/Homebrew/rubocops/extend/formula_cop.rb
index de369a0aa..e53c02a44 100644
--- a/Library/Homebrew/rubocops/extend/formula_cop.rb
+++ b/Library/Homebrew/rubocops/extend/formula_cop.rb
@@ -425,7 +425,7 @@ module RuboCop
# Returns the block length of the block node
def block_size(block)
- block_length(block)
+ block.loc.end.line - block.loc.begin.line
end
# Source buffer is required as an argument to report style violations
diff --git a/Library/Homebrew/rubocops/formula_desc_cop.rb b/Library/Homebrew/rubocops/formula_desc_cop.rb
index 8a35e7d24..240a28072 100644
--- a/Library/Homebrew/rubocops/formula_desc_cop.rb
+++ b/Library/Homebrew/rubocops/formula_desc_cop.rb
@@ -88,8 +88,6 @@ module RuboCop
problem "Description shouldn't end with a full stop"
end
- private
-
def autocorrect(node)
lambda do |corrector|
correction = node.source
diff --git a/Library/Homebrew/rubocops/urls_cop.rb b/Library/Homebrew/rubocops/urls_cop.rb
index 414f633c9..4ef801689 100644
--- a/Library/Homebrew/rubocops/urls_cop.rb
+++ b/Library/Homebrew/rubocops/urls_cop.rb
@@ -206,8 +206,6 @@ module RuboCop
end
end
- private
-
def autocorrect(node)
lambda do |corrector|
url_string_node = parameters(node).first
diff --git a/Library/Homebrew/test/Gemfile b/Library/Homebrew/test/Gemfile
index 2dcb670aa..b6d1405ff 100644
--- a/Library/Homebrew/test/Gemfile
+++ b/Library/Homebrew/test/Gemfile
@@ -3,7 +3,6 @@ source "https://rubygems.org"
require_relative "../constants"
gem "parallel_tests"
-gem "parser", HOMEBREW_RUBOCOP_PARSER_VERSION
gem "rspec"
gem "rspec-its", require: false
gem "rspec-wait", require: false
diff --git a/Library/Homebrew/test/Gemfile.lock b/Library/Homebrew/test/Gemfile.lock
index 9ddc18e71..47f51e56b 100644
--- a/Library/Homebrew/test/Gemfile.lock
+++ b/Library/Homebrew/test/Gemfile.lock
@@ -12,12 +12,10 @@ GEM
parallel (1.12.0)
parallel_tests (2.17.0)
parallel
- parser (2.4.0.0)
- ast (~> 2.2)
+ parser (2.4.0.2)
+ ast (~> 2.3)
powerpack (0.1.1)
- rainbow (2.2.2)
- rake
- rake (12.1.0)
+ rainbow (3.0.0)
rspec (3.6.0)
rspec-core (~> 3.6.0)
rspec-expectations (~> 3.6.0)
@@ -36,11 +34,11 @@ GEM
rspec-support (3.6.0)
rspec-wait (0.0.9)
rspec (>= 3, < 4)
- rubocop (0.51.0)
+ rubocop (0.52.1)
parallel (~> 1.10)
- parser (>= 2.3.3.1, < 3.0)
+ parser (>= 2.4.0.2, < 3.0)
powerpack (~> 0.1)
- rainbow (>= 2.2.2, < 3.0)
+ rainbow (>= 2.2.2, < 4.0)
ruby-progressbar (~> 1.7)
unicode-display_width (~> 1.0, >= 1.0.1)
ruby-progressbar (1.9.0)
@@ -58,11 +56,10 @@ PLATFORMS
DEPENDENCIES
codecov
parallel_tests
- parser (= 2.4.0.0)
rspec
rspec-its
rspec-wait
- rubocop (= 0.51.0)
+ rubocop (= 0.52.1)
simplecov
BUNDLED WITH
diff --git a/Library/Homebrew/test/cask/dsl_spec.rb b/Library/Homebrew/test/cask/dsl_spec.rb
index a17acfca6..cd296b5ab 100644
--- a/Library/Homebrew/test/cask/dsl_spec.rb
+++ b/Library/Homebrew/test/cask/dsl_spec.rb
@@ -232,8 +232,9 @@ describe Hbc::DSL, :cask do
expect(cask.caveats).to be_empty
cask = Hbc::Cask.new("cask-with-caveats") do
- def caveats; <<~EOS
- When you install this Cask, you probably want to know this.
+ def caveats
+ <<~EOS
+ When you install this Cask, you probably want to know this.
EOS
end
end
diff --git a/Library/Homebrew/test/cmd/style_spec.rb b/Library/Homebrew/test/cmd/style_spec.rb
index 5c118f32e..61faa4af2 100644
--- a/Library/Homebrew/test/cmd/style_spec.rb
+++ b/Library/Homebrew/test/cmd/style_spec.rb
@@ -28,7 +28,7 @@ describe "brew style" do
rubocop_result = Homebrew.check_style_json([formula])
expect(rubocop_result.file_offenses(formula.realpath.to_s).map(&:message))
- .to include("Extra empty line detected at class body beginning.")
+ .to include("Layout/EmptyLinesAroundClassBody: Extra empty line detected at class body beginning.")
end
end
end
diff --git a/Library/Homebrew/test/dependency_collector_spec.rb b/Library/Homebrew/test/dependency_collector_spec.rb
index 216bbf316..0f182a69e 100644
--- a/Library/Homebrew/test/dependency_collector_spec.rb
+++ b/Library/Homebrew/test/dependency_collector_spec.rb
@@ -66,11 +66,6 @@ describe DependencyCollector do
expect(dep).to be_optional
end
- specify "ant dependency", :needs_compat do
- subject.add ant: :build
- expect(find_dependency("ant")).to eq(Dependency.new("ant", [:build]))
- end
-
it "doesn't mutate the dependency spec" do
spec = { "foo" => :optional }
copy = spec.dup
diff --git a/Library/Homebrew/test/mpi_requirement_spec.rb b/Library/Homebrew/test/mpi_requirement_spec.rb
index 87f99eb3a..aecdb1b66 100644
--- a/Library/Homebrew/test/mpi_requirement_spec.rb
+++ b/Library/Homebrew/test/mpi_requirement_spec.rb
@@ -1,14 +1,13 @@
-require "compat/requirements/mpi_requirement"
+require "compat/requirements"
describe MPIRequirement, :needs_compat do
describe "::new" do
- subject { described_class.new(*(wrappers + tags)) }
+ subject { described_class.new(wrappers + tags) }
let(:wrappers) { [:cc, :cxx, :f77] }
let(:tags) { [:optional, "some-other-tag"] }
- it "untangles wrappers and tags" do
- expect(subject.lang_list).to eq(wrappers)
- expect(subject.tags).to eq(tags)
+ it "stores wrappers as tags" do
+ expect(subject.tags).to eq(wrappers + tags)
end
end
end
diff --git a/Library/Homebrew/test/support/helper/output_as_tty.rb b/Library/Homebrew/test/support/helper/output_as_tty.rb
index aa9da73cc..22f96510e 100644
--- a/Library/Homebrew/test/support/helper/output_as_tty.rb
+++ b/Library/Homebrew/test/support/helper/output_as_tty.rb
@@ -19,7 +19,7 @@ module Test
return super(block) unless @tty
colored_tty_block = lambda do
- instance_eval("$#{@output}").extend(Module.new do
+ instance_eval("$#{@output}", __FILE__, __LINE__).extend(Module.new do
def tty?
true
end
@@ -32,7 +32,7 @@ module Test
return super(colored_tty_block) if @colors
uncolored_tty_block = lambda do
- instance_eval <<-EOS
+ instance_eval <<-EOS, __FILE__, __LINE__ + 1
begin
captured_stream = StringIO.new
diff --git a/Library/Homebrew/utils.rb b/Library/Homebrew/utils.rb
index c6e7d22df..a1fb0d235 100644
--- a/Library/Homebrew/utils.rb
+++ b/Library/Homebrew/utils.rb
@@ -101,7 +101,8 @@ def odeprecated(method, replacement = nil, disable: false, disable_on: nil, call
if ARGV.homebrew_developer? || disable ||
Homebrew.raise_deprecation_exceptions?
- raise MethodDeprecatedError, message
+ developer_message = message + "Or, even better, submit a PR to fix it!"
+ raise MethodDeprecatedError, developer_message
elsif !Homebrew.auditing?
opoo "#{message}\n"
end
diff --git a/Library/Homebrew/utils/curl.rb b/Library/Homebrew/utils/curl.rb
index cf1735576..65edd85df 100644
--- a/Library/Homebrew/utils/curl.rb
+++ b/Library/Homebrew/utils/curl.rb
@@ -2,10 +2,13 @@ require "pathname"
require "open3"
def curl_executable
- curl = Pathname.new ENV["HOMEBREW_CURL"]
- curl = which("curl") unless curl.exist?
- return curl if curl.executable?
- raise "#{curl} is not executable"
+ @curl ||= [
+ ENV["HOMEBREW_CURL"],
+ which("curl"),
+ "/usr/bin/curl",
+ ].map { |c| Pathname(c) }.find(&:executable?)
+ raise "curl is not executable" unless @curl
+ @curl
end
def curl_args(*extra_args, show_output: false, user_agent: :default)
diff --git a/Library/Homebrew/utils/github.rb b/Library/Homebrew/utils/github.rb
index be9bf4dd3..016676323 100644
--- a/Library/Homebrew/utils/github.rb
+++ b/Library/Homebrew/utils/github.rb
@@ -129,7 +129,7 @@ module GitHub
# This is a no-op if the user is opting out of using the GitHub API.
return block_given? ? yield({}) : {} if ENV["HOMEBREW_NO_GITHUB_API"]
- args = %W[--header application/vnd.github.v3+json --write-out \n%{http_code}]
+ args = %W[--header application/vnd.github.v3+json --write-out \n%{http_code}] # rubocop:disable Lint/NestedPercentLiteral
args += curl_args
token, username = api_credentials
diff --git a/completions/bash/brew b/completions/bash/brew
index 3bde8f926..02c862bbd 100644
--- a/completions/bash/brew
+++ b/completions/bash/brew
@@ -51,7 +51,7 @@ __brewcomp() {
__brew_complete_formulae() {
local cur="${COMP_WORDS[COMP_CWORD]}"
local formulas="$(brew search)"
- local shortnames="$(echo "$formulas" | grep / | cut -d / -f 3)"
+ local shortnames="$(echo "$formulas" | \grep / | \cut -d / -f 3)"
COMPREPLY=($(compgen -W "$formulas $shortnames" -- "$cur"))
}
@@ -593,7 +593,7 @@ __brew_cask_complete_formulae ()
local lib=$(brew --repository)/Library
local taps=${lib}/Taps
local casks=${lib}/Taps/caskroom/homebrew-cask/Casks
- local ff=$(\ls ${casks} 2>/dev/null | sed 's/\.rb//g')
+ local ff=$(\ls ${casks} 2>/dev/null | \sed 's/\.rb//g')
COMPREPLY=($(compgen -W "$ff" -- "$cur"))
}
@@ -613,6 +613,13 @@ __brew_cask_complete_caskroom ()
COMPREPLY=($(compgen -W "$files" -- "$cur"))
}
+__brew_cask_complete_outdated ()
+{
+ local cur="${COMP_WORDS[COMP_CWORD]}"
+ local outdated=$(brew cask outdated --quiet)
+ COMPREPLY=($(compgen -W "$outdated" -- "$cur"))
+}
+
_brew_cask_cleanup ()
{
local cur="${COMP_WORDS[COMP_CWORD]}"
@@ -638,17 +645,53 @@ _brew_cask_fetch ()
__brew_cask_complete_formulae
}
+_brew_cask_install ()
+{
+ local cur="${COMP_WORDS[COMP_CWORD]}"
+ local prv=$(__brew_caskcomp_prev)
+ case "$cur" in
+ -*)
+ __brew_caskcomp "--force --skip-cask-deps --require-sha --language"
+ return
+ ;;
+ esac
+ __brew_cask_complete_formulae
+}
+
_brew_cask_list ()
{
local cur="${COMP_WORDS[COMP_CWORD]}"
+ case "$cur" in
+ -*)
+ __brew_caskcomp "-1 --versions"
+ return
+ ;;
+ esac
+ __brew_cask_complete_installed
+}
+
+_brew_cask_outdated ()
+{
+ local cur="${COMP_WORDS[COMP_CWORD]}"
case "$cur" in
-*)
- __brew_caskcomp "-1 -l --versions"
+ __brew_caskcomp "--greedy --verbose --quiet"
return
;;
esac
+ __brew_cask_complete_installed
+}
+_brew_cask_style ()
+{
+ local cur="${COMP_WORDS[COMP_CWORD]}"
+ case "$cur" in
+ -*)
+ __brew_caskcomp "--fix"
+ return
+ ;;
+ esac
__brew_cask_complete_installed
}
@@ -664,6 +707,18 @@ _brew_cask_uninstall ()
__brew_cask_complete_installed
}
+_brew_cask_upgrade ()
+{
+ local cur="${COMP_WORDS[COMP_CWORD]}"
+ case "$cur" in
+ -*)
+ __brew_caskcomp "--force --greedy"
+ return
+ ;;
+ esac
+ __brew_cask_complete_outdated
+}
+
_brew_cask ()
{
local i=1 cmd
@@ -689,24 +744,30 @@ _brew_cask ()
done
if [[ $i -eq $COMP_CWORD ]]; then
- __brew_caskcomp "abv audit cat cleanup create doctor edit fetch home info install list ls remove rm search uninstall zap -S --force --caskroom --verbose --appdir --colorpickerdir --prefpanedir --qlplugindir --fontdir --servicedir --input_methoddir --internet_plugindir --screen_saverdir --no-binaries --binarydir --debug"
+ __brew_caskcomp "abv audit cat cleanup create doctor edit fetch home info install list ls outdated reinstall remove rm search style uninstall upgrade zap -S --force --caskroom --verbose --appdir --colorpickerdir --prefpanedir --qlplugindir --fontdir --servicedir --input_methoddir --internet_plugindir --screen_saverdir --no-binaries --debug --version"
return
fi
# subcommands have their own completion functions
case "$cmd" in
+ --version) __brewcomp_null ;;
audit) __brew_cask_complete_formulae ;;
cat) __brew_cask_complete_formulae ;;
cleanup) _brew_cask_cleanup ;;
- doctor) ;;
+ create) ;;
+ doctor) __brewcomp_null ;;
edit) __brew_cask_complete_formulae ;;
fetch) _brew_cask_fetch ;;
home) __brew_cask_complete_formulae ;;
info|abv) __brew_cask_complete_formulae ;;
- install|instal) __brew_cask_complete_formulae ;;
+ install|instal) _brew_cask_install ;;
list|ls) _brew_cask_list ;;
- search) ;;
+ outdated) _brew_cask_outdated ;;
+ reinstall) __brew_cask_complete_installed ;;
+ search) __brewcomp_null ;;
+ style) _brew_cask_style ;;
uninstall|remove|rm) _brew_cask_uninstall ;;
+ upgrade) _brew_cask_upgrade ;;
zap) __brew_cask_complete_caskroom ;;
*) ;;
esac
@@ -738,7 +799,7 @@ _brew() {
then
# Do not auto-complete "*instal" or "*uninstal" aliases for "*install" commands.
# Prefix newline to prevent not checking the first command.
- local cmds=$'\n'"$(brew commands --quiet --include-aliases | grep -v instal$)"
+ local cmds=$'\n'"$(brew commands --quiet --include-aliases | \grep -v instal$)"
__brewcomp "${cmds}"
return
fi
diff --git a/completions/zsh/_brew b/completions/zsh/_brew
index 22792860d..e4f874bfb 100644
--- a/completions/zsh/_brew
+++ b/completions/zsh/_brew
@@ -711,7 +711,7 @@ _brew_uninstall() {
# brew unlink [--dry-run] formula:
_brew_unlink() {
_arguments \
- '(--dry-run =n)'{--dry-run,=n}'[don''t unlink or delete any files]' \
+ '(--dry-run -n)'{--dry-run,-n}'[don''t unlink or delete any files]' \
':formula:__brew_installed_formulae'
}
@@ -719,7 +719,7 @@ _brew_unlink() {
_brew_unlinkapps() {
_arguments \
'(--local)--local[remove symlinks from ~/Applications instead of the system directory]' \
- '(--dry-run =n)'{--dry-run,-n}'[don''t unlink or delete any files]' \
+ '(--dry-run -n)'{--dry-run,-n}'[don''t unlink or delete any files]' \
':formula:__brew_installed_formulae'
}
diff --git a/completions/zsh/_brew_cask b/completions/zsh/_brew_cask
index ff277ea60..d702ea093 100644
--- a/completions/zsh/_brew_cask
+++ b/completions/zsh/_brew_cask
@@ -12,17 +12,21 @@
zstyle -T ':completion:*:*:*:brew-cask:*' tag-order && \
zstyle ':completion:*:*:*:brew-cask:*' tag-order 'commands'
+__brew_cask() {
+ [ -d "$(brew --repo caskroom/cask)" ] && brew cask $@
+}
+
__brew_all_casks() {
local -a list
local expl
- list=( $(brew cask search) )
+ list=( $(__brew_cask search) )
_wanted list expl 'all casks' compadd -a list
}
__brew_installed_casks() {
local -a list
local expl
- list=( $(brew cask list|sed 's/(!)//') )
+ list=( $(__brew_cask list|sed 's/(!)//') )
_wanted list expl 'installed casks' compadd -a list
}
diff --git a/docs/.ruby-version b/docs/.ruby-version
index bec3a35ee..005119baa 100644
--- a/docs/.ruby-version
+++ b/docs/.ruby-version
@@ -1 +1 @@
-system
+2.4.1
diff --git a/docs/Formula-Cookbook.md b/docs/Formula-Cookbook.md
index b40c765c6..c4db9e9f8 100644
--- a/docs/Formula-Cookbook.md
+++ b/docs/Formula-Cookbook.md
@@ -106,8 +106,8 @@ The `README` probably tells you about dependencies and Homebrew or macOS probabl
* `libiconv`
* `libpcap`
* `libxml2`
-* `Python`
-* `Ruby`
+* `python`
+* `ruby`
There are plenty of others; check `/usr/lib` for them.
@@ -132,7 +132,6 @@ to favour finding `keg_only` formulae first.
class Foo < Formula
depends_on "pkg-config" => :run
depends_on "jpeg"
- depends_on "boost" => "with-icu"
depends_on "readline" => :recommended
depends_on "gtk+" => :optional
depends_on :x11 => :optional
@@ -165,19 +164,6 @@ A Hash (e.g. `=>`) specifies a formula dependency with some additional informati
depends_on "foo" => :optional # Generated description is "Build with foo support"
```
-* a String or an Array
-
- String values are interpreted as options to be passed to the dependency.
- You can also pass an array of strings, or an array of symbols and strings,
- in which case the symbols are interpreted as described above, and the
- strings are passed to the dependency as options.
-
- ```ruby
- depends_on "foo" => "with-bar"
- depends_on "foo" => %w{with-bar with-baz}
- depends_on "foo" => [:optional, "with-bar"]
- ```
-
### Specifying conflicts with other formulae
Sometimes there’s hard conflict between formulae, and it can’t be avoided or circumvented with [`keg_only`](http://www.rubydoc.info/github/Homebrew/brew/master/Formula#keg_only-class_method).
@@ -426,7 +412,7 @@ Note that values *can* contain unescaped spaces if you use the multiple-argument
## Patches
-While [`patch`](http://www.rubydoc.info/github/Homebrew/brew/master/Formula#patch-class_method)es should generally be avoided, sometimes they are necessary.
+While [`patch`](http://www.rubydoc.info/github/Homebrew/brew/master/Formula#patch-class_method)es should generally be avoided, sometimes they are temporarily necessary.
When [`patch`](http://www.rubydoc.info/github/Homebrew/brew/master/Formula#patch-class_method)ing (i.e. fixing header file inclusion, fixing compiler warnings, etc.) the first thing to do is check whether or not the upstream project is aware of the issue. If not, file a bug report and/or submit your patch for inclusion. We may sometimes still accept your patch before it was submitted upstream but by getting the ball rolling on fixing the upstream issue you reduce the length of time we have to carry the patch around.
@@ -551,14 +537,9 @@ end
Sometimes a package fails to build when using a certain compiler. Since recent [Xcode versions](Xcode.md) no longer include a GCC compiler we cannot simply force the use of GCC. Instead, the correct way to declare this is the [`fails_with` DSL method](http://www.rubydoc.info/github/Homebrew/brew/master/Formula#fails_with-class_method). A properly constructed [`fails_with`](http://www.rubydoc.info/github/Homebrew/brew/master/Formula#fails_with-class_method) block documents the latest compiler build version known to cause compilation to fail, and the cause of the failure. For example:
```ruby
-fails_with :llvm do
- build 2335
- cause <<~EOS
- The "cause" field should include a short summary of the error. Include
- the URLs of any relevant information, such as upstream bug reports. Wrap
- the text at a sensible boundary (~72-80 characters), but do not break
- URLs over multiple lines.
- EOS
+fails_with :clang do
+ build 211
+ cause "Miscompilation resulting in segfault on queries"
end
```
@@ -767,13 +748,7 @@ brew -S --fink foo
## Fortran
-Some software requires a Fortran compiler. This can be declared by adding `depends_on :fortran` to a formula. `:fortran` is a `Requirement` that does several things.
-
-First, it looks to see if you have set the `FC` environment variable. If it is set, Homebrew will use this value during compilation. If it is not set, it will check to see if `gfortran` is found in `PATH`. If it is, Homebrew will use its location as the value of `FC`. Otherwise, the `gcc` formula will be treated as a dependency and installed prior to compilation.
-
-If you have set `FC` to a custom Fortran compiler, you may additionally set `FCFLAGS` and `FFLAGS`. Alternatively, you can pass `--default-fortran-flags` to `brew install` to use Homebrew's standard `CFLAGS`.
-
-When using Homebrew's `gfortran` compiler, the standard `CFLAGS` are used and user-supplied values of `FCFLAGS` and `FFLAGS` are ignored for consistency and reproducibility reasons.
+Some software requires a Fortran compiler. This can be declared by adding `depends_on "gcc"` to a formula.
## How to start over (reset to upstream `master`)
diff --git a/docs/Gemfile b/docs/Gemfile
index fac2f802d..0c8671cde 100644
--- a/docs/Gemfile
+++ b/docs/Gemfile
@@ -1,6 +1,3 @@
source "https://rubygems.org"
gem "github-pages", group: :jekyll_plugins
-
-# Nokogiri >=1.7 requires Ruby >=2.1
-gem "nokogiri", "<1.7"
diff --git a/docs/Gemfile.lock b/docs/Gemfile.lock
new file mode 100644
index 000000000..b5fc90306
--- /dev/null
+++ b/docs/Gemfile.lock
@@ -0,0 +1,219 @@
+GEM
+ remote: https://rubygems.org/
+ specs:
+ activesupport (4.2.8)
+ i18n (~> 0.7)
+ minitest (~> 5.1)
+ thread_safe (~> 0.3, >= 0.3.4)
+ tzinfo (~> 1.1)
+ addressable (2.5.2)
+ public_suffix (>= 2.0.2, < 4.0)
+ coffee-script (2.4.1)
+ coffee-script-source
+ execjs
+ coffee-script-source (1.12.2)
+ colorator (1.1.0)
+ concurrent-ruby (1.0.5)
+ ethon (0.11.0)
+ ffi (>= 1.3.0)
+ execjs (2.7.0)
+ faraday (0.13.1)
+ multipart-post (>= 1.2, < 3)
+ ffi (1.9.18)
+ forwardable-extended (2.6.0)
+ gemoji (3.0.0)
+ github-pages (158)
+ activesupport (= 4.2.8)
+ github-pages-health-check (= 1.3.5)
+ jekyll (= 3.5.2)
+ jekyll-avatar (= 0.4.2)
+ jekyll-coffeescript (= 1.0.1)
+ jekyll-default-layout (= 0.1.4)
+ jekyll-feed (= 0.9.2)
+ jekyll-gist (= 1.4.1)
+ jekyll-github-metadata (= 2.9.1)
+ jekyll-mentions (= 1.2.0)
+ jekyll-optional-front-matter (= 0.2.0)
+ jekyll-paginate (= 1.1.0)
+ jekyll-readme-index (= 0.1.0)
+ jekyll-redirect-from (= 0.12.1)
+ jekyll-relative-links (= 0.4.1)
+ jekyll-sass-converter (= 1.5.0)
+ jekyll-seo-tag (= 2.3.0)
+ jekyll-sitemap (= 1.0.0)
+ jekyll-swiss (= 0.4.0)
+ jekyll-theme-architect (= 0.1.0)
+ jekyll-theme-cayman (= 0.1.0)
+ jekyll-theme-dinky (= 0.1.0)
+ jekyll-theme-hacker (= 0.1.0)
+ jekyll-theme-leap-day (= 0.1.0)
+ jekyll-theme-merlot (= 0.1.0)
+ jekyll-theme-midnight (= 0.1.0)
+ jekyll-theme-minimal (= 0.1.0)
+ jekyll-theme-modernist (= 0.1.0)
+ jekyll-theme-primer (= 0.5.2)
+ jekyll-theme-slate (= 0.1.0)
+ jekyll-theme-tactile (= 0.1.0)
+ jekyll-theme-time-machine (= 0.1.0)
+ jekyll-titles-from-headings (= 0.4.0)
+ jemoji (= 0.8.0)
+ kramdown (= 1.13.2)
+ liquid (= 4.0.0)
+ listen (= 3.0.6)
+ mercenary (~> 0.3)
+ minima (= 2.1.1)
+ rouge (= 1.11.1)
+ terminal-table (~> 1.4)
+ github-pages-health-check (1.3.5)
+ addressable (~> 2.3)
+ net-dns (~> 0.8)
+ octokit (~> 4.0)
+ public_suffix (~> 2.0)
+ typhoeus (~> 0.7)
+ html-pipeline (2.7.1)
+ activesupport (>= 2)
+ nokogiri (>= 1.4)
+ i18n (0.9.1)
+ concurrent-ruby (~> 1.0)
+ jekyll (3.5.2)
+ addressable (~> 2.4)
+ colorator (~> 1.0)
+ jekyll-sass-converter (~> 1.0)
+ jekyll-watch (~> 1.1)
+ kramdown (~> 1.3)
+ liquid (~> 4.0)
+ mercenary (~> 0.3.3)
+ pathutil (~> 0.9)
+ rouge (~> 1.7)
+ safe_yaml (~> 1.0)
+ jekyll-avatar (0.4.2)
+ jekyll (~> 3.0)
+ jekyll-coffeescript (1.0.1)
+ coffee-script (~> 2.2)
+ jekyll-default-layout (0.1.4)
+ jekyll (~> 3.0)
+ jekyll-feed (0.9.2)
+ jekyll (~> 3.3)
+ jekyll-gist (1.4.1)
+ octokit (~> 4.2)
+ jekyll-github-metadata (2.9.1)
+ jekyll (~> 3.1)
+ octokit (~> 4.0, != 4.4.0)
+ jekyll-mentions (1.2.0)
+ activesupport (~> 4.0)
+ html-pipeline (~> 2.3)
+ jekyll (~> 3.0)
+ jekyll-optional-front-matter (0.2.0)
+ jekyll (~> 3.0)
+ jekyll-paginate (1.1.0)
+ jekyll-readme-index (0.1.0)
+ jekyll (~> 3.0)
+ jekyll-redirect-from (0.12.1)
+ jekyll (~> 3.3)
+ jekyll-relative-links (0.4.1)
+ jekyll (~> 3.3)
+ jekyll-sass-converter (1.5.0)
+ sass (~> 3.4)
+ jekyll-seo-tag (2.3.0)
+ jekyll (~> 3.3)
+ jekyll-sitemap (1.0.0)
+ jekyll (~> 3.3)
+ jekyll-swiss (0.4.0)
+ jekyll-theme-architect (0.1.0)
+ jekyll (~> 3.5)
+ jekyll-seo-tag (~> 2.0)
+ jekyll-theme-cayman (0.1.0)
+ jekyll (~> 3.5)
+ jekyll-seo-tag (~> 2.0)
+ jekyll-theme-dinky (0.1.0)
+ jekyll (~> 3.5)
+ jekyll-seo-tag (~> 2.0)
+ jekyll-theme-hacker (0.1.0)
+ jekyll (~> 3.5)
+ jekyll-seo-tag (~> 2.0)
+ jekyll-theme-leap-day (0.1.0)
+ jekyll (~> 3.5)
+ jekyll-seo-tag (~> 2.0)
+ jekyll-theme-merlot (0.1.0)
+ jekyll (~> 3.5)
+ jekyll-seo-tag (~> 2.0)
+ jekyll-theme-midnight (0.1.0)
+ jekyll (~> 3.5)
+ jekyll-seo-tag (~> 2.0)
+ jekyll-theme-minimal (0.1.0)
+ jekyll (~> 3.5)
+ jekyll-seo-tag (~> 2.0)
+ jekyll-theme-modernist (0.1.0)
+ jekyll (~> 3.5)
+ jekyll-seo-tag (~> 2.0)
+ jekyll-theme-primer (0.5.2)
+ jekyll (~> 3.5)
+ jekyll-github-metadata (~> 2.9)
+ jekyll-seo-tag (~> 2.2)
+ jekyll-theme-slate (0.1.0)
+ jekyll (~> 3.5)
+ jekyll-seo-tag (~> 2.0)
+ jekyll-theme-tactile (0.1.0)
+ jekyll (~> 3.5)
+ jekyll-seo-tag (~> 2.0)
+ jekyll-theme-time-machine (0.1.0)
+ jekyll (~> 3.5)
+ jekyll-seo-tag (~> 2.0)
+ jekyll-titles-from-headings (0.4.0)
+ jekyll (~> 3.3)
+ jekyll-watch (1.5.1)
+ listen (~> 3.0)
+ jemoji (0.8.0)
+ activesupport (~> 4.0)
+ gemoji (~> 3.0)
+ html-pipeline (~> 2.2)
+ jekyll (>= 3.0)
+ kramdown (1.13.2)
+ liquid (4.0.0)
+ listen (3.0.6)
+ rb-fsevent (>= 0.9.3)
+ rb-inotify (>= 0.9.7)
+ mercenary (0.3.6)
+ mini_portile2 (2.3.0)
+ minima (2.1.1)
+ jekyll (~> 3.3)
+ minitest (5.11.1)
+ multipart-post (2.0.0)
+ net-dns (0.8.0)
+ nokogiri (1.8.1)
+ mini_portile2 (~> 2.3.0)
+ octokit (4.8.0)
+ sawyer (~> 0.8.0, >= 0.5.3)
+ pathutil (0.16.1)
+ forwardable-extended (~> 2.6)
+ public_suffix (2.0.5)
+ rb-fsevent (0.10.2)
+ rb-inotify (0.9.10)
+ ffi (>= 0.5.0, < 2)
+ rouge (1.11.1)
+ safe_yaml (1.0.4)
+ sass (3.5.5)
+ sass-listen (~> 4.0.0)
+ sass-listen (4.0.0)
+ rb-fsevent (~> 0.9, >= 0.9.4)
+ rb-inotify (~> 0.9, >= 0.9.7)
+ sawyer (0.8.1)
+ addressable (>= 2.3.5, < 2.6)
+ faraday (~> 0.8, < 1.0)
+ terminal-table (1.8.0)
+ unicode-display_width (~> 1.1, >= 1.1.1)
+ thread_safe (0.3.6)
+ typhoeus (0.8.0)
+ ethon (>= 0.8.0)
+ tzinfo (1.2.4)
+ thread_safe (~> 0.1)
+ unicode-display_width (1.3.0)
+
+PLATFORMS
+ ruby
+
+DEPENDENCIES
+ github-pages
+
+BUNDLED WITH
+ 1.16.0
diff --git a/docs/Homebrew-and-Python.md b/docs/Homebrew-and-Python.md
index 740e973d2..eb96e5758 100644
--- a/docs/Homebrew-and-Python.md
+++ b/docs/Homebrew-and-Python.md
@@ -69,7 +69,7 @@ Homebrew builds bindings against the first `python` (and `python-config`) in you
**Warning!** Python may crash (see [Common Issues](Common-Issues.md)) if you `import <module>` from a brewed Python if you ran `brew install <formula_with_python_bindings>` against the system Python. If you decide to switch to the brewed Python, then reinstall all formulae with Python bindings (e.g. `pyside`, `wxwidgets`, `pygtk`, `pygobject`, `opencv`, `vtk` and `boost-python`).
## Policy for non-brewed Python bindings
-These should be installed via `pip install <package>`. To discover, you can use `pip search` or <https://pypi.python.org/pypi>. (**Note:** System Python does not provide `pip`. Follow the instructions at <https://pip.readthedocs.io/en/stable/installing/#install-pip> to install it for your system Python if you would like it.)
+These should be installed via `pip install <package>`. To discover, you can use `pip search` or <https://pypi.python.org/pypi>. (**Note:** System Python does not provide `pip`. Follow the [pip documentation](https://pip.readthedocs.io/en/stable/installing/#install-pip) to install it for your system Python if you would like it.)
## Brewed Python modules
For brewed Python, modules installed with `pip` or `python setup.py install` will be installed to the `$(brew --prefix)/lib/pythonX.Y/site-packages` directory (explained above). Executable Python scripts will be in `$(brew --prefix)/bin`.
@@ -89,4 +89,4 @@ Homebrew will still install Python modules into Homebrew's `site-packages` and *
Virtualenv has a `--system-site-packages` switch to allow "global" (i.e. Homebrew's) `site-packages` to be accessible from within the virtualenv.
## Why is Homebrew's Python being installed as a dependency?
-Formulae that depend on the special `:python` target are bottled against the Homebrew Python and require it to be installed. You can avoid installing Homebrew's Python by building these formulae with `--build-from-source`.
+Formulae that declare an unconditional dependency on the `"python"` or `"python3"` formulae are bottled against Homebrew's Python 2.7.x or 3.x and require it to be installed.
diff --git a/docs/Interesting-Taps-and-Forks.md b/docs/Interesting-Taps-and-Forks.md
index 20fe0efde..5115fd9d5 100644
--- a/docs/Interesting-Taps-and-Forks.md
+++ b/docs/Interesting-Taps-and-Forks.md
@@ -29,6 +29,10 @@ You can be added as a maintainer for one of the Homebrew organization taps and a
* [osrf/simulation](https://github.com/osrf/homebrew-simulation): Tools for robotics simulation.
+* [brewsci/bio](https://github.com/brewsci/homebrew-bio): Bioinformatics formulae.
+
+* [brewsci/science](https://github.com/brewsci/homebrew-science): Software tailored to scientific endeavours.
+
## Interesting forks
* [mistydemeo/tigerbrew](https://github.com/mistydemeo/tigerbrew): Experimental Tiger PowerPC version
diff --git a/docs/Node-for-Formula-Authors.md b/docs/Node-for-Formula-Authors.md
index f1a50a8c3..4053706c1 100644
--- a/docs/Node-for-Formula-Authors.md
+++ b/docs/Node-for-Formula-Authors.md
@@ -34,10 +34,10 @@ If your formula requires being executed with an older Node version you should us
### Special requirements for native addons
-If your Node module is a native addon or has a native addon somewhere in its dependency tree you have to declare an additional dependency. Since the compilation of the native addon results in an invocation of `node-gyp` we need an additional build time dependency on `:python` (because gyp depends on Python 2.7).
+If your Node module is a native addon or has a native addon somewhere in its dependency tree you have to declare an additional dependency. Since the compilation of the native addon results in an invocation of `node-gyp` we need an additional build time dependency on `"python"` (because GYP depends on Python 2.7).
```ruby
-depends_on :python => :build
+depends_on "python" => :build
```
Also note that such a formula would only be compatible with the same Node major version it originally was compiled with. This means that we need to revision every formula with a Node native addon with every major version bump of the `node` formula. To make sure we don't overlook your formula on a Node major version bump, write a meaningful test which would fail in such a case (invoked with an ABI-incompatible Node version).
@@ -99,7 +99,7 @@ class Foo < Formula
depends_on "node"
# uncomment if there is a native addon inside the dependency tree
- # depends_on :python => :build
+ # depends_on "python" => :build
def install
system "npm", "install", *Language::Node.std_npm_install_args(libexec)
diff --git a/docs/Python-for-Formula-Authors.md b/docs/Python-for-Formula-Authors.md
index 723601afe..a530dbef7 100644
--- a/docs/Python-for-Formula-Authors.md
+++ b/docs/Python-for-Formula-Authors.md
@@ -19,12 +19,12 @@ Applications should unconditionally bundle all of their Python-language dependen
Applications that are compatible with Python 2 **should** use the Apple-provided system Python in `/usr/bin` on systems that provide Python 2.7. To do this, declare:
```ruby
-depends_on :python if MacOS.version <= :snow_leopard
+depends_on "python" if MacOS.version <= :snow_leopard
```
-No explicit Python dependency is needed on recent OS versions since `/usr/bin` is always in `PATH` for Homebrew formulae; on Leopard and older, the python in `PATH` is used if it's at least version 2.7, or else Homebrew's python is installed.
+No explicit Python dependency is needed on recent OS versions since `/usr/bin` is always in `PATH` for Homebrew formulae; on Leopard and older, the `python` in `PATH` is used if it's at least version 2.7, or else Homebrew's Python 2.7.x is installed.
-Formulae for apps that require Python 3 **should** declare an unconditional dependency on `:python3`, which will cause the formula to use the first python3 discovered in `PATH` at install time (or install Homebrew's if there isn't one). These apps **must** work with the current Homebrew python3 formula.
+Formulae for apps that require Python 3 **should** declare an unconditional dependency on `"python3"`. These apps **must** work with the current Homebrew Python 3.x formula.
### Installing
@@ -66,7 +66,7 @@ This is exactly the same as writing:
```ruby
def install
# Create a virtualenv in `libexec`. If your app needs Python 3, make sure that
- # `depends_on :python3` is declared, and use `virtualenv_create(libexec, "python3")`.
+ # `depends_on "python3"` is declared, and use `virtualenv_create(libexec, "python3")`.
venv = virtualenv_create(libexec)
# Install all of the resources declared on the formula into the virtualenv.
venv.pip_install resources
@@ -121,9 +121,9 @@ in case you need to do different things for different resources.
## Bindings
-Build bindings with system Python by default (don't add an option) and they should be usable with any binary-compatible Python. If that isn't the case, it's an upstream bug; [here's some advice for resolving it](http://blog.tim-smith.us/2015/09/python-extension-modules-os-x/).
+Build bindings with the system Python by default (don't add an option) and they should be usable with any binary-compatible Python. If that isn't the case, it's an upstream bug; [here's some advice for resolving it](http://blog.tim-smith.us/2015/09/python-extension-modules-os-x/).
-To add bindings for Python 3, please add `depends_on :python3 => :optional` and make the bindings conditional on `build.with?("python3")`.
+To add bindings for Python 3, please add `depends_on "python3" => :optional` and make the bindings conditional on `build.with?("python3")`.
### Dependencies
@@ -153,7 +153,7 @@ Sometimes we have to `inreplace` a `Makefile` to use our prefix for the Python b
### Python declarations
-Python 2 libraries do not need a `depends_on :python` declaration; they will be built with system Python, but should still be usable with any other Python 2.7. If this is not the case, it is an upstream bug; [here is some advice for resolving it](http://blog.tim-smith.us/2015/09/python-extension-modules-os-x/). Libraries built for Python 3 should include `depends_on :python3`, which will bottle against Homebrew's python3, and use the first python3 discovered in `PATH` at build time when installing from source with `brew install --build-from-source`. If a library supports both Python 2.x and Python 3.x, the `:python3` dependency should be `:optional`. Python 2.x libraries must function when they are installed against either the system Python or Homebrew Python.
+Python 2 libraries do not need a `depends_on "python"` declaration; they will be built with the system Python, but should still be usable with any other Python 2.7. If this is not the case, it is an upstream bug; [here is some advice for resolving it](http://blog.tim-smith.us/2015/09/python-extension-modules-os-x/). Libraries built for Python 3 should include `depends_on "python3"`, which will bottle against Homebrew's Python 3.x. If a library supports both Python 2.x and Python 3.x, the `"python3"` dependency should be `:optional`. Python 2.x libraries must function when they are installed against either the system Python or brewed Python.
### Installing