diff options
| -rw-r--r-- | Library/Homebrew/brew.sh | 18 | ||||
| -rw-r--r-- | Library/Homebrew/cask/lib/hbc/cask_loader.rb | 6 | ||||
| -rw-r--r-- | Library/Homebrew/cmd/gist-logs.rb | 20 | ||||
| -rw-r--r-- | Library/Homebrew/formula_installer.rb | 8 | ||||
| -rw-r--r-- | Library/Homebrew/test/spec_helper.rb | 4 | ||||
| -rw-r--r-- | Library/Homebrew/test/utils/svn_spec.rb | 2 | 
6 files changed, 33 insertions, 25 deletions
| diff --git a/Library/Homebrew/brew.sh b/Library/Homebrew/brew.sh index 47064c61b..61d85ddd2 100644 --- a/Library/Homebrew/brew.sh +++ b/Library/Homebrew/brew.sh @@ -75,7 +75,6 @@ case "$HOMEBREW_SYSTEM" in    Linux)  HOMEBREW_LINUX="1" ;;  esac -HOMEBREW_CURL="curl"  if [[ -n "$HOMEBREW_MACOS" ]]  then    HOMEBREW_PROCESSOR="$(uname -p)" @@ -97,13 +96,6 @@ then      HOMEBREW_FORCE_BREWED_CURL="1"    fi -  if [[ -n "$HOMEBREW_FORCE_BREWED_CURL" && -        -x "$HOMEBREW_PREFIX/opt/curl/bin/curl" ]] && -           "$HOMEBREW_PREFIX/opt/curl/bin/curl" --version >/dev/null -  then -    HOMEBREW_CURL="$HOMEBREW_PREFIX/opt/curl/bin/curl" -  fi -    if [[ -z "$HOMEBREW_CACHE" ]]    then      HOMEBREW_CACHE="$HOME/Library/Caches/Homebrew" @@ -125,6 +117,16 @@ else      fi    fi  fi + +if [[ -n "$HOMEBREW_FORCE_BREWED_CURL" && +      -x "$HOMEBREW_PREFIX/opt/curl/bin/curl" ]] && +         "$HOMEBREW_PREFIX/opt/curl/bin/curl" --version >/dev/null +then +  HOMEBREW_CURL="$HOMEBREW_PREFIX/opt/curl/bin/curl" +else +  HOMEBREW_CURL="curl" +fi +  HOMEBREW_USER_AGENT="$HOMEBREW_PRODUCT/$HOMEBREW_USER_AGENT_VERSION ($HOMEBREW_SYSTEM; $HOMEBREW_PROCESSOR $HOMEBREW_OS_USER_AGENT_VERSION)"  HOMEBREW_CURL_VERSION="$("$HOMEBREW_CURL" --version 2>/dev/null | head -n1 | awk '{print $1"/"$2}')"  HOMEBREW_USER_AGENT_CURL="$HOMEBREW_USER_AGENT $HOMEBREW_CURL_VERSION" diff --git a/Library/Homebrew/cask/lib/hbc/cask_loader.rb b/Library/Homebrew/cask/lib/hbc/cask_loader.rb index c32b35584..74c39176d 100644 --- a/Library/Homebrew/cask/lib/hbc/cask_loader.rb +++ b/Library/Homebrew/cask/lib/hbc/cask_loader.rb @@ -16,11 +16,11 @@ module Hbc        end        def initialize(content) -        @content = content +        @content = content.force_encoding("UTF-8")        end        def load -        instance_eval(content.force_encoding("UTF-8"), __FILE__, __LINE__) +        instance_eval(content, __FILE__, __LINE__)        end        private @@ -52,7 +52,7 @@ module Hbc          @content = IO.read(path) -        super +        instance_eval(content, path)        end        private diff --git a/Library/Homebrew/cmd/gist-logs.rb b/Library/Homebrew/cmd/gist-logs.rb index 630361ca2..ab81a017e 100644 --- a/Library/Homebrew/cmd/gist-logs.rb +++ b/Library/Homebrew/cmd/gist-logs.rb @@ -39,6 +39,16 @@ module Homebrew        files["00.tap.out"] = { content: tap }      end +    if GitHub.api_credentials_type == :none +      puts <<~EOS +        You can create a new personal access token: +         #{GitHub::ALL_SCOPES_URL} +        and then set the new HOMEBREW_GITHUB_API_TOKEN as the authentication method. + +      EOS +      login! +    end +      # Description formatted to work well as page title when viewing gist      if f.core_formula?        descr = "#{f.name} on #{OS_VERSION} - Homebrew build logs" @@ -48,16 +58,6 @@ module Homebrew      url = create_gist(files, descr)      if ARGV.include?("--new-issue") || ARGV.switch?("n") -      if GitHub.api_credentials_type == :none -        puts <<~EOS -          You can create a new personal access token: -           #{GitHub::ALL_SCOPES_URL} -          and then set the new HOMEBREW_GITHUB_API_TOKEN as the authentication method. - -        EOS -        login! -      end -        url = create_issue(f.tap, "#{f.name} failed to build on #{MacOS.full_version}", url)      end diff --git a/Library/Homebrew/formula_installer.rb b/Library/Homebrew/formula_installer.rb index a89da9ae9..8d7f0aae1 100644 --- a/Library/Homebrew/formula_installer.rb +++ b/Library/Homebrew/formula_installer.rb @@ -566,7 +566,7 @@ class FormulaInstaller    def caveats      return if only_deps? -    audit_installed if ARGV.homebrew_developer? && !formula.keg_only? +    audit_installed if ARGV.homebrew_developer?      caveats = Caveats.new(formula) @@ -882,8 +882,10 @@ class FormulaInstaller    end    def audit_installed -    problem_if_output(check_env_path(formula.bin)) -    problem_if_output(check_env_path(formula.sbin)) +    unless formula.keg_only? +      problem_if_output(check_env_path(formula.bin)) +      problem_if_output(check_env_path(formula.sbin)) +    end      super    end diff --git a/Library/Homebrew/test/spec_helper.rb b/Library/Homebrew/test/spec_helper.rb index 865342ddf..cba530736 100644 --- a/Library/Homebrew/test/spec_helper.rb +++ b/Library/Homebrew/test/spec_helper.rb @@ -75,6 +75,10 @@ RSpec.configure do |config|      skip "Requires network connection." unless ENV["HOMEBREW_TEST_ONLINE"]    end +  config.before(:each, :needs_svn) do +    skip "Requires subversion." unless which "svn" +  end +    config.around(:each) do |example|      def find_files        Find.find(TEST_TMPDIR) diff --git a/Library/Homebrew/test/utils/svn_spec.rb b/Library/Homebrew/test/utils/svn_spec.rb index 503d285f3..f527a614f 100644 --- a/Library/Homebrew/test/utils/svn_spec.rb +++ b/Library/Homebrew/test/utils/svn_spec.rb @@ -30,7 +30,7 @@ describe Utils do          expect(described_class.svn_remote_exists(HOMEBREW_CACHE/"install")).to be_falsey        end -      it "returns true when remote exists", :needs_network do +      it "returns true when remote exists", :needs_network, :needs_svn do          remote = "http://github.com/Homebrew/install"          svn = HOMEBREW_SHIMS_PATH/"scm/svn" | 
