diff --git a/Library/Homebrew/diagnostic.rb b/Library/Homebrew/diagnostic.rb index 55df9aca8c..03b2d557e4 100644 --- a/Library/Homebrew/diagnostic.rb +++ b/Library/Homebrew/diagnostic.rb @@ -791,6 +791,17 @@ module Homebrew end.join("\n") end + def check_homebrew_prefix + return if HOMEBREW_PREFIX.to_s == Homebrew::DEFAULT_PREFIX + + <<~EOS + Your Homebrew's prefix is not #{Homebrew::DEFAULT_PREFIX}. + You can install Homebrew anywhere you want but some bottles (binary packages) + can only be used with a standard prefix and some formulae (packages) + may not build correctly with a non-standard prefix. + EOS + end + def all methods.map(&:to_s).grep(/^check_/) end diff --git a/Library/Homebrew/extend/os/mac/diagnostic.rb b/Library/Homebrew/extend/os/mac/diagnostic.rb index 0af10f9698..4fef6eaf7c 100644 --- a/Library/Homebrew/extend/os/mac/diagnostic.rb +++ b/Library/Homebrew/extend/os/mac/diagnostic.rb @@ -284,17 +284,6 @@ module Homebrew EOS end - def check_homebrew_prefix - return if HOMEBREW_PREFIX.to_s == "/usr/local" - - <<~EOS - Your Homebrew's prefix is not /usr/local. - You can install Homebrew anywhere you want but some bottles (binary packages) - can only be used with a /usr/local prefix and some formulae (packages) - may not build correctly with a non-/usr/local prefix. - EOS - end - def check_for_gettext find_relative_paths("lib/libgettextlib.dylib", "lib/libintl.dylib", diff --git a/Library/Homebrew/test/diagnostic_checks_spec.rb b/Library/Homebrew/test/diagnostic_checks_spec.rb index bf5bfcf2ca..74f0b57ab0 100644 --- a/Library/Homebrew/test/diagnostic_checks_spec.rb +++ b/Library/Homebrew/test/diagnostic_checks_spec.rb @@ -162,4 +162,10 @@ describe Homebrew::Diagnostic::Checks do end end end + + specify "#check_homebrew_prefix" do + # the integration tests are run in a special prefix + expect(subject.check_homebrew_prefix) + .to match("Your Homebrew's prefix is not #{Homebrew::DEFAULT_PREFIX}") + end end diff --git a/Library/Homebrew/test/os/mac/diagnostic_spec.rb b/Library/Homebrew/test/os/mac/diagnostic_spec.rb index 22cbd158f1..b4a7ecc1bd 100644 --- a/Library/Homebrew/test/os/mac/diagnostic_spec.rb +++ b/Library/Homebrew/test/os/mac/diagnostic_spec.rb @@ -32,12 +32,6 @@ describe Homebrew::Diagnostic::Checks do .to match("Xcode alone is not sufficient on El Capitan") end - specify "#check_homebrew_prefix" do - # the integration tests are run in a special prefix - expect(subject.check_homebrew_prefix) - .to match("Your Homebrew's prefix is not /usr/local.") - end - specify "#check_ruby_version" do allow(MacOS).to receive(:version).and_return(OS::Mac::Version.new("10.12")) stub_const("RUBY_VERSION", "1.8.6") diff --git a/azure-pipelines.yml b/azure-pipelines.yml index f99a0ae86c..627f5d7f14 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -36,7 +36,11 @@ jobs: vmImage: ubuntu-16.04 steps: - bash: | - "$PWD/bin/brew" test-bot + HOMEBREW_REPOSITORY=/home/linuxbrew/.linuxbrew + sudo mkdir -p /home/linuxbrew + sudo mv "$PWD" "$HOMEBREW_REPOSITORY" + sudo ln -s "$HOMEBREW_REPOSITORY" "$PWD" + "$HOMEBREW_REPOSITORY/bin/brew" test-bot displayName: Run brew test-bot env: HOMEBREW_GITHUB_API_TOKEN: $(github.publicApiToken)