diff options
| -rw-r--r-- | .travis.yml | 2 | ||||
| -rw-r--r-- | Library/Homebrew/brew.sh | 2 | ||||
| -rw-r--r-- | Library/Homebrew/cmd/vendor-install.sh | 10 | ||||
| -rw-r--r-- | Library/Homebrew/extend/os/mac/development_tools.rb | 2 | ||||
| -rw-r--r-- | Library/Homebrew/extend/os/mac/diagnostic.rb | 4 | ||||
| -rw-r--r-- | Library/Homebrew/extend/os/mac/extend/ENV/super.rb | 10 | ||||
| -rw-r--r-- | Library/Homebrew/os/mac.rb | 4 | ||||
| -rw-r--r-- | Library/Homebrew/test/rubocops/lines_cop_spec.rb | 41 | ||||
| -rw-r--r-- | Library/Homebrew/test/version_spec.rb | 14 | ||||
| -rw-r--r-- | Library/Homebrew/utils/ruby.sh | 13 | ||||
| -rw-r--r-- | Library/Homebrew/vendor/portable-ruby-version | 2 |
11 files changed, 79 insertions, 25 deletions
diff --git a/.travis.yml b/.travis.yml index dfdb7fc85..94b83fc11 100644 --- a/.travis.yml +++ b/.travis.yml @@ -15,7 +15,7 @@ matrix: rvm: system - os: linux sudo: false - rvm: 2.0.0 + rvm: 2.3.3 before_install: - export HOMEBREW_NO_AUTO_UPDATE=1 diff --git a/Library/Homebrew/brew.sh b/Library/Homebrew/brew.sh index 66908925c..b2859c927 100644 --- a/Library/Homebrew/brew.sh +++ b/Library/Homebrew/brew.sh @@ -23,7 +23,7 @@ HOMEBREW_VERSION="$(git -C "$HOMEBREW_REPOSITORY" describe --tags --dirty --abbr HOMEBREW_USER_AGENT_VERSION="$HOMEBREW_VERSION" if [[ -z "$HOMEBREW_VERSION" ]] then - HOMEBREW_VERSION=">1.2.0 (no git repository)" + HOMEBREW_VERSION=">1.2.0 (shallow or no git repository)" HOMEBREW_USER_AGENT_VERSION="1.X.Y" fi diff --git a/Library/Homebrew/cmd/vendor-install.sh b/Library/Homebrew/cmd/vendor-install.sh index fe7e26dd4..4ffa17659 100644 --- a/Library/Homebrew/cmd/vendor-install.sh +++ b/Library/Homebrew/cmd/vendor-install.sh @@ -13,16 +13,16 @@ if [[ -n "$HOMEBREW_MACOS" ]] then if [[ "$HOMEBREW_PROCESSOR" = "Intel" ]] then - ruby_URL="https://homebrew.bintray.com/bottles-portable/portable-ruby-2.0.0-p648.leopard_64.bottle.tar.gz" - ruby_SHA="5c1240abe4be91c9774a0089c2a38a8ccfff87c009e8e5786730c659d5e633f7" + ruby_URL="https://homebrew.bintray.com/bottles-portable/portable-ruby-2.3.3.leopard_64.bottle.tar.gz" + ruby_SHA="9060cdddbc5b5a0cc7188a251c40b2845e9d8b8ce346c83c585a965a111cab54" else ruby_URL="" ruby_SHA="" fi elif [[ -n "$HOMEBREW_LINUX" ]] then - ruby_URL="https://homebrew.bintray.com/bottles-portable/portable-ruby-2.0.0-p648.x86_64_linux.bottle.tar.gz" - ruby_SHA="dbb5118a22a6a75cc77e62544a3d8786d383fab1bdaf8c154951268807357bf0" + ruby_URL="https://homebrew.bintray.com/bottles-portable/portable-ruby-2.3.3.x86_64_linux.bottle.tar.gz" + ruby_SHA="543c18bd33a300e6c16671437b1e0f17b03bb64e6a485fc15ff7de1eb1a0bc2a" fi fetch() { @@ -135,7 +135,7 @@ install() { fi safe_cd "$VENDOR_DIR" - [[ -n "$HOMEBREW_QUIET" ]] || echo "==> Unpacking $(basename "$VENDOR_URL")" + [[ -n "$HOMEBREW_QUIET" ]] || echo "==> Pouring $(basename "$VENDOR_URL")" tar "$tar_args" "$CACHED_LOCATION" safe_cd "$VENDOR_DIR/portable-$VENDOR_NAME" diff --git a/Library/Homebrew/extend/os/mac/development_tools.rb b/Library/Homebrew/extend/os/mac/development_tools.rb index ed2a1fc9e..1931b398d 100644 --- a/Library/Homebrew/extend/os/mac/development_tools.rb +++ b/Library/Homebrew/extend/os/mac/development_tools.rb @@ -85,7 +85,7 @@ class DevelopmentTools def curl_handles_most_https_certificates? # The system Curl is too old for some modern HTTPS certificates on # older macOS versions. - !ENV["HOMEBREW_SYSTEM_CURL_TOO_OLD"].nil? + ENV["HOMEBREW_SYSTEM_CURL_TOO_OLD"].nil? end def subversion_handles_most_https_certificates? diff --git a/Library/Homebrew/extend/os/mac/diagnostic.rb b/Library/Homebrew/extend/os/mac/diagnostic.rb index ab5433565..9f7b18b49 100644 --- a/Library/Homebrew/extend/os/mac/diagnostic.rb +++ b/Library/Homebrew/extend/os/mac/diagnostic.rb @@ -195,8 +195,8 @@ module Homebrew end def check_ruby_version - ruby_version = "2.0" - return if RUBY_VERSION[/\d\.\d/] == ruby_version + ruby_version = "2.3.3" + return if RUBY_VERSION == ruby_version return if ARGV.homebrew_developer? && OS::Mac.prerelease? <<-EOS.undent diff --git a/Library/Homebrew/extend/os/mac/extend/ENV/super.rb b/Library/Homebrew/extend/os/mac/extend/ENV/super.rb index 9c20cc7c6..5872c2264 100644 --- a/Library/Homebrew/extend/os/mac/extend/ENV/super.rb +++ b/Library/Homebrew/extend/os/mac/extend/ENV/super.rb @@ -96,9 +96,13 @@ module Superenv self["SDKROOT"] = MacOS.sdk_path end - # Filter out symbols known not to be defined on 10.11 since GNU Autotools - # can't reliably figure this out with Xcode 8 on its own yet. - if MacOS.version == "10.11" && MacOS::Xcode.installed? && MacOS::Xcode.version >= "8.0" + # Filter out symbols known not to be defined since GNU Autotools can't + # reliably figure this out with Xcode 8 and above. + if MacOS.version == "10.12" && MacOS::Xcode.installed? && MacOS::Xcode.version >= "9.0" + %w[fmemopen futimens open_memstream utimensat].each do |s| + ENV["ac_cv_func_#{s}"] = "no" + end + elsif MacOS.version == "10.11" && MacOS::Xcode.installed? && MacOS::Xcode.version >= "8.0" %w[basename_r clock_getres clock_gettime clock_settime dirname_r getentropy mkostemp mkostemps timingsafe_bcmp].each do |s| ENV["ac_cv_func_#{s}"] = "no" diff --git a/Library/Homebrew/os/mac.rb b/Library/Homebrew/os/mac.rb index bc75fc322..52fa2a187 100644 --- a/Library/Homebrew/os/mac.rb +++ b/Library/Homebrew/os/mac.rb @@ -34,12 +34,12 @@ module OS def prerelease? # TODO: bump version when new OS is released - version >= "10.13" + version >= "10.14" end def outdated_release? # TODO: bump version when new OS is released - version < "10.10" + version < "10.11" end def cat diff --git a/Library/Homebrew/test/rubocops/lines_cop_spec.rb b/Library/Homebrew/test/rubocops/lines_cop_spec.rb index 31aafbcf8..d93962688 100644 --- a/Library/Homebrew/test/rubocops/lines_cop_spec.rb +++ b/Library/Homebrew/test/rubocops/lines_cop_spec.rb @@ -380,6 +380,21 @@ describe RuboCop::Cop::FormulaAudit::Miscellaneous do end end + it "with build.universal? exempted formula" do + source = <<-EOS.undent + class Wine < Formula + desc "foo" + url 'http://example.com/foo-1.0.tgz' + if build.universal? + "foo" + end + end + EOS + + inspect_source(cop, source, "/homebrew-core/Formula/wine.rb") + expect(cop.offenses).to eq([]) + end + it "with ENV.universal_binary" do source = <<-EOS.undent class Foo < Formula @@ -450,6 +465,19 @@ describe RuboCop::Cop::FormulaAudit::Miscellaneous do end end + it "with ruby-macho alternatives audit exempted formula" do + source = <<-EOS.undent + class Cctools < Formula + desc "foo" + url 'http://example.com/foo-1.0.tgz' + system "install_name_tool", "-id" + end + EOS + + inspect_source(cop, source, "/homebrew-core/Formula/cctools.rb") + expect(cop.offenses).to eq([]) + end + it "with npm install without language::Node args" do source = <<-EOS.undent class Foo < Formula @@ -471,5 +499,18 @@ describe RuboCop::Cop::FormulaAudit::Miscellaneous do expect_offense(expected, actual) end end + + it "with npm install without language::Node args in kibana" do + source = <<-EOS.undent + class KibanaAT44 < Formula + desc "foo" + url 'http://example.com/foo-1.0.tgz' + system "npm", "install" + end + EOS + + inspect_source(cop, source, "/homebrew-core/Formula/kibana@4.4.rb") + expect(cop.offenses).to eq([]) + end end end diff --git a/Library/Homebrew/test/version_spec.rb b/Library/Homebrew/test/version_spec.rb index cee57e935..d670d79c8 100644 --- a/Library/Homebrew/test/version_spec.rb +++ b/Library/Homebrew/test/version_spec.rb @@ -241,8 +241,18 @@ describe Version do describe "::detect" do matcher :be_detected_from do |url, specs = {}| - match do |version| - Version.detect(url, specs) == version + detected = Version.detect(url, specs) + + match do |expected| + detected == expected + end + + failure_message do |expected| + message = <<-EOS + expected: %s + detected: %s + EOS + format(message, expected, detected) end end diff --git a/Library/Homebrew/utils/ruby.sh b/Library/Homebrew/utils/ruby.sh index 6945c068b..813bb0999 100644 --- a/Library/Homebrew/utils/ruby.sh +++ b/Library/Homebrew/utils/ruby.sh @@ -2,7 +2,8 @@ setup-ruby-path() { local vendor_dir local vendor_ruby_current_version local vendor_ruby_path - local ruby_version_major + local ruby_old_version + local minimum_ruby_version="2.3.3" vendor_dir="$HOMEBREW_LIBRARY/Homebrew/vendor" vendor_ruby_current_version="$vendor_dir/portable-ruby/current" @@ -21,7 +22,7 @@ setup-ruby-path() { if [[ $(readlink "$vendor_ruby_current_version") != "$(<"$vendor_dir/portable-ruby-version")" ]] then - if ! brew vendor-install ruby --quiet + if ! brew vendor-install ruby then onoe "Failed to upgrade vendor Ruby." fi @@ -36,14 +37,12 @@ setup-ruby-path() { if [[ -n "$HOMEBREW_RUBY_PATH" ]] then - ruby_version_major="$("$HOMEBREW_RUBY_PATH" --version)" - ruby_version_major="${ruby_version_major#ruby }" - ruby_version_major="${ruby_version_major%%.*}" + ruby_old_version="$("$HOMEBREW_RUBY_PATH" -e "puts Gem::Version.new('$minimum_ruby_version') > Gem::Version.new(RUBY_VERSION)")" fi - if [[ "$ruby_version_major" != "2" || -n "$HOMEBREW_FORCE_VENDOR_RUBY" ]] + if [[ "$ruby_old_version" == "true" || -n "$HOMEBREW_FORCE_VENDOR_RUBY" ]] then - brew vendor-install ruby --quiet + brew vendor-install ruby if [[ ! -x "$vendor_ruby_path" ]] then odie "Failed to install vendor Ruby." diff --git a/Library/Homebrew/vendor/portable-ruby-version b/Library/Homebrew/vendor/portable-ruby-version index 633c00da3..0bee604df 100644 --- a/Library/Homebrew/vendor/portable-ruby-version +++ b/Library/Homebrew/vendor/portable-ruby-version @@ -1 +1 @@ -2.0.0-p648 +2.3.3 |
