aboutsummaryrefslogtreecommitdiffstats
path: root/Library
diff options
context:
space:
mode:
Diffstat (limited to 'Library')
-rw-r--r--Library/Homebrew/brew.sh24
-rw-r--r--Library/Homebrew/caveats.rb2
-rw-r--r--Library/Homebrew/cmd/update.sh3
-rw-r--r--Library/Homebrew/diagnostic.rb10
-rw-r--r--Library/Homebrew/extend/os/mac/diagnostic.rb13
-rw-r--r--Library/Homebrew/formula_installer.rb7
-rw-r--r--Library/Homebrew/hooks/bottles.rb35
-rw-r--r--Library/Homebrew/os/mac/xcode.rb23
-rw-r--r--Library/Homebrew/test/bottle_hooks_spec.rb51
-rw-r--r--Library/Homebrew/test/os/mac/diagnostic_spec.rb8
10 files changed, 26 insertions, 150 deletions
diff --git a/Library/Homebrew/brew.sh b/Library/Homebrew/brew.sh
index c8f66bd45..795ddcc4d 100644
--- a/Library/Homebrew/brew.sh
+++ b/Library/Homebrew/brew.sh
@@ -79,18 +79,6 @@ then
export HOMEBREW_GEM_PATH="$GEM_PATH"
fi
-# Users may have these set, pointing the system Ruby
-# at non-system gem paths
-unset GEM_HOME
-unset GEM_PATH
-
-# Users may have this set, injecting arbitrary environment changes into
-# bash processes inside builds
-unset BASH_ENV
-
-# Users may have this set, breaking grep's output.
-unset GREP_OPTIONS
-
HOMEBREW_SYSTEM="$(uname -s)"
case "$HOMEBREW_SYSTEM" in
Darwin) HOMEBREW_MACOS="1" ;;
@@ -246,6 +234,18 @@ case "$HOMEBREW_COMMAND" in
--config) HOMEBREW_COMMAND="config" ;;
esac
+# Set HOMEBREW_DEV_CMD_RUN for users who have run a development command.
+# This makes them behave like HOMEBREW_DEVELOPERs for brew update.
+if [[ -z "$HOMEBREW_DEVELOPER" ]]
+then
+ export HOMEBREW_GIT_CONFIG_FILE="$HOMEBREW_REPOSITORY/.git/config"
+ HOMEBREW_GIT_CONFIG_DEVELOPERMODE="$(git config --file="$HOMEBREW_GIT_CONFIG_FILE" --get homebrew.devcmdrun 2>/dev/null)"
+ if [[ "$HOMEBREW_GIT_CONFIG_DEVELOPERMODE" = "true" ]]
+ then
+ export HOMEBREW_DEV_CMD_RUN="1"
+ fi
+fi
+
if [[ -f "$HOMEBREW_LIBRARY/Homebrew/cmd/$HOMEBREW_COMMAND.sh" ]]
then
HOMEBREW_BASH_COMMAND="$HOMEBREW_LIBRARY/Homebrew/cmd/$HOMEBREW_COMMAND.sh"
diff --git a/Library/Homebrew/caveats.rb b/Library/Homebrew/caveats.rb
index 49a517bd4..98321f1a1 100644
--- a/Library/Homebrew/caveats.rb
+++ b/Library/Homebrew/caveats.rb
@@ -64,7 +64,7 @@ class Caveats
s << "\nFor compilers to find this software you may need to set:\n"
s << " LDFLAGS: -L#{f.opt_lib}\n" if f.lib.directory?
s << " CPPFLAGS: -I#{f.opt_include}\n" if f.include.directory?
- if which("pkg-config") &&
+ if which("pkg-config", ENV["HOMEBREW_PATH"]) &&
((f.lib/"pkgconfig").directory? || (f.share/"pkgconfig").directory?)
s << "For pkg-config to find this software you may need to set:\n"
s << " PKG_CONFIG_PATH: #{f.opt_lib}/pkgconfig\n" if (f.lib/"pkgconfig").directory?
diff --git a/Library/Homebrew/cmd/update.sh b/Library/Homebrew/cmd/update.sh
index 609e4094a..747784527 100644
--- a/Library/Homebrew/cmd/update.sh
+++ b/Library/Homebrew/cmd/update.sh
@@ -410,9 +410,6 @@ EOS
QUIET_ARGS=()
fi
- # ensure GIT_CONFIG is unset as we need to operate on .git/config
- unset GIT_CONFIG
-
# only allow one instance of brew update
lock update
diff --git a/Library/Homebrew/diagnostic.rb b/Library/Homebrew/diagnostic.rb
index 61f9b53a3..41deaf23e 100644
--- a/Library/Homebrew/diagnostic.rb
+++ b/Library/Homebrew/diagnostic.rb
@@ -1017,16 +1017,6 @@ module Homebrew
EOS
end
- def check_for_old_env_vars
- return unless ENV["HOMEBREW_KEEP_INFO"]
-
- <<~EOS
- `HOMEBREW_KEEP_INFO` is no longer used
- info files are no longer deleted by default; you may
- remove this environment variable.
- EOS
- end
-
def check_for_pth_support
homebrew_site_packages = Language::Python.homebrew_site_packages
return unless homebrew_site_packages.directory?
diff --git a/Library/Homebrew/extend/os/mac/diagnostic.rb b/Library/Homebrew/extend/os/mac/diagnostic.rb
index f86155f2e..bb89b2367 100644
--- a/Library/Homebrew/extend/os/mac/diagnostic.rb
+++ b/Library/Homebrew/extend/os/mac/diagnostic.rb
@@ -262,19 +262,6 @@ module Homebrew
EOS
end
- def check_for_unsupported_curl_vars
- # Support for SSL_CERT_DIR seemed to be removed in the 10.10.5 update.
- return unless MacOS.version >= :yosemite
- return if ENV["SSL_CERT_DIR"].nil?
-
- <<~EOS
- SSL_CERT_DIR support was removed from Apple's curl.
- If fetching formulae fails you should:
- unset SSL_CERT_DIR
- and remove it from #{Utils::Shell.profile} if present.
- EOS
- end
-
def check_xcode_license_approved
# If the user installs Xcode-only, they have to approve the
# license or no "xc*" tool will work.
diff --git a/Library/Homebrew/formula_installer.rb b/Library/Homebrew/formula_installer.rb
index 12a8a80bc..0836e7a9f 100644
--- a/Library/Homebrew/formula_installer.rb
+++ b/Library/Homebrew/formula_installer.rb
@@ -9,7 +9,6 @@ require "cleaner"
require "formula_cellar_checks"
require "install_renamed"
require "cmd/postinstall"
-require "hooks/bottles"
require "debrew"
require "sandbox"
require "emoji"
@@ -81,8 +80,6 @@ class FormulaInstaller
end
def pour_bottle?(install_bottle_options = { warn: false })
- return true if Homebrew::Hooks::Bottles.formula_has_bottle?(formula)
-
return false if @pour_failed
return false if !formula.bottled? && !formula.local_bottle_path
@@ -858,10 +855,6 @@ class FormulaInstaller
end
def pour
- if Homebrew::Hooks::Bottles.formula_has_bottle?(formula)
- return if Homebrew::Hooks::Bottles.pour_formula_bottle(formula)
- end
-
if (bottle_path = formula.local_bottle_path)
downloader = LocalBottleDownloadStrategy.new(bottle_path)
else
diff --git a/Library/Homebrew/hooks/bottles.rb b/Library/Homebrew/hooks/bottles.rb
deleted file mode 100644
index c6612dea6..000000000
--- a/Library/Homebrew/hooks/bottles.rb
+++ /dev/null
@@ -1,35 +0,0 @@
-# Boxen (and perhaps others) want to override our bottling infrastructure so
-# they can avoid declaring checksums in formulae files.
-# Instead of periodically breaking their monkeypatches let's add some hooks that
-# we can query to allow their own behaviour.
-
-# PLEASE DO NOT EVER RENAME THIS CLASS OR ADD/REMOVE METHOD ARGUMENTS!
-module Homebrew
- module Hooks
- module Bottles
- def self.setup_formula_has_bottle(&block)
- @has_bottle = block
- true
- end
-
- def self.setup_pour_formula_bottle(&block)
- @pour_bottle = block
- true
- end
-
- def self.formula_has_bottle?(formula)
- return false unless @has_bottle
- @has_bottle.call formula
- end
-
- def self.pour_formula_bottle(formula)
- return false unless @pour_bottle
- @pour_bottle.call formula
- end
-
- def self.reset_hooks
- @has_bottle = @pour_bottle = nil
- end
- end
- end
-end
diff --git a/Library/Homebrew/os/mac/xcode.rb b/Library/Homebrew/os/mac/xcode.rb
index 0b1cc7146..f977a066d 100644
--- a/Library/Homebrew/os/mac/xcode.rb
+++ b/Library/Homebrew/os/mac/xcode.rb
@@ -17,13 +17,13 @@ module OS
when "10.9" then "6.2"
when "10.10" then "7.2.1"
when "10.11" then "8.2.1"
- when "10.12" then "9.1"
- when "10.13" then "9.1"
+ when "10.12" then "9.2"
+ when "10.13" then "9.2"
else
raise "macOS '#{MacOS.version}' is invalid" unless OS::Mac.prerelease?
# Default to newest known version of Xcode for unreleased macOS versions.
- "9.1"
+ "9.2"
end
end
@@ -141,7 +141,11 @@ module OS
end
end
- # The remaining logic provides a fake Xcode version based on the
+ detect_version_from_clang_version
+ end
+
+ def detect_version_from_clang_version
+ # This logic provides a fake Xcode version based on the
# installed CLT version. This is useful as they are packaged
# simultaneously so workarounds need to apply to both based on their
# comparable version.
@@ -166,7 +170,7 @@ module OS
when 80 then "8.0"
when 81 then "8.3"
when 90 then "9.0"
- else "9.0"
+ else "9.0"
end
end
@@ -217,14 +221,13 @@ module OS
# on the older supported platform for that Xcode release, i.e there's no
# CLT package for 10.11 that contains the Clang version from Xcode 8.
case MacOS.version
- when "10.13" then "900.0.38"
- when "10.12" then "900.0.38"
+ when "10.13" then "900.0.39.2"
+ when "10.12" then "900.0.39.2"
when "10.11" then "800.0.42.1"
when "10.10" then "700.1.81"
when "10.9" then "600.0.57"
when "10.8" then "503.0.40"
- else
- "425.0.28"
+ else "425.0.28"
end
end
@@ -232,7 +235,7 @@ module OS
case MacOS.version
when "10.13" then "9.0.0"
when "10.12" then "8.0.0"
- else "1.0.0"
+ else "1.0.0"
end
end
diff --git a/Library/Homebrew/test/bottle_hooks_spec.rb b/Library/Homebrew/test/bottle_hooks_spec.rb
deleted file mode 100644
index eb6617380..000000000
--- a/Library/Homebrew/test/bottle_hooks_spec.rb
+++ /dev/null
@@ -1,51 +0,0 @@
-require "formula_installer"
-require "hooks/bottles"
-
-describe Homebrew::Hooks::Bottles do
- alias_matcher :pour_bottle, :be_pour_bottle
-
- subject { FormulaInstaller.new formula }
-
- let(:formula) do
- double(
- bottled?: false,
- local_bottle_path: nil,
- bottle_disabled?: false,
- some_random_method: true,
- keg_only?: false,
- )
- end
-
- after(:each) do
- described_class.reset_hooks
- end
-
- describe "#setup_formula_has_bottle" do
- context "given a block which evaluates to true" do
- before(:each) do
- described_class.setup_formula_has_bottle(&:some_random_method)
- end
-
- it { is_expected.to pour_bottle }
- end
-
- context "given a block which evaluates to false" do
- before(:each) do
- described_class.setup_formula_has_bottle { |f| !f.some_random_method }
- end
-
- it { is_expected.not_to pour_bottle }
- end
- end
-
- describe "#setup_pour_formula_bottle" do
- before(:each) do
- described_class.setup_formula_has_bottle { true }
- described_class.setup_pour_formula_bottle(&:some_random_method)
- end
-
- it "does not raise an error" do
- expect { subject.pour }.not_to raise_error
- end
- end
-end
diff --git a/Library/Homebrew/test/os/mac/diagnostic_spec.rb b/Library/Homebrew/test/os/mac/diagnostic_spec.rb
index 83d95c2ef..f04652a93 100644
--- a/Library/Homebrew/test/os/mac/diagnostic_spec.rb
+++ b/Library/Homebrew/test/os/mac/diagnostic_spec.rb
@@ -15,14 +15,6 @@ describe Homebrew::Diagnostic::Checks do
.to match("We do not provide support for this pre-release version.")
end
- specify "#check_for_unsupported_curl_vars" do
- allow(MacOS).to receive(:version).and_return(OS::Mac::Version.new("10.10"))
- ENV["SSL_CERT_DIR"] = "/some/path"
-
- expect(subject.check_for_unsupported_curl_vars)
- .to match("SSL_CERT_DIR support was removed from Apple's curl.")
- end
-
specify "#check_for_beta_xquartz" do
allow(MacOS::XQuartz).to receive(:version).and_return("2.7.10_beta2")