From e747648c53267111691e38f1f53c8951f7baf1b0 Mon Sep 17 00:00:00 2001 From: Martin Afanasjew Date: Wed, 6 Apr 2016 01:26:12 +0200 Subject: [PATCH] always prefer HOMEBREW_CURL over plain 'curl' --- Library/Homebrew/cmd/update.sh | 2 +- Library/Homebrew/utils/analytics.rb | 4 ++-- Library/brew.sh | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Library/Homebrew/cmd/update.sh b/Library/Homebrew/cmd/update.sh index d6ce41b006..8ffd2eadb1 100644 --- a/Library/Homebrew/cmd/update.sh +++ b/Library/Homebrew/cmd/update.sh @@ -304,7 +304,7 @@ EOS UPSTREAM_BRANCH_LOCAL_SHA="$(git rev-parse "refs/remotes/origin/$UPSTREAM_BRANCH")" # Only try to `git fetch` when the upstream branch is at a different SHA # (so the API does not return 304: unmodified). - UPSTREAM_SHA_HTTP_CODE="$(curl --silent '--max-time' 3 \ + UPSTREAM_SHA_HTTP_CODE="$("$HOMEBREW_CURL" --silent '--max-time' 3 \ --output /dev/null --write-out "%{http_code}" \ --user-agent "$HOMEBREW_USER_AGENT_CURL" \ --header "Accept: application/vnd.github.chitauri-preview+sha" \ diff --git a/Library/Homebrew/utils/analytics.rb b/Library/Homebrew/utils/analytics.rb index 9995a174f7..15de204455 100644 --- a/Library/Homebrew/utils/analytics.rb +++ b/Library/Homebrew/utils/analytics.rb @@ -16,8 +16,8 @@ def report_analytics(type, metadata={}) # any personally identifiable information. # https://developers.google.com/analytics/devguides/collection/protocol/v1/devguide # https://developers.google.com/analytics/devguides/collection/protocol/v1/parameters - system "curl", "https://www.google-analytics.com/collect", "-d", "v=1", - "--silent", "--max-time", "3", "--output", "/dev/null", + system ENV["HOMEBREW_CURL"], "https://www.google-analytics.com/collect", + "-d", "v=1", "--silent", "--max-time", "3", "--output", "/dev/null", "--user-agent", "#{HOMEBREW_USER_AGENT_CURL}", "-d", "tid=#{ENV["HOMEBREW_ANALYTICS_ID"]}", "-d", "cid=#{ENV["HOMEBREW_ANALYTICS_USER_UUID"]}", diff --git a/Library/brew.sh b/Library/brew.sh index 78f42ba3d5..7c5d07bf4c 100644 --- a/Library/brew.sh +++ b/Library/brew.sh @@ -218,7 +218,7 @@ then # information. # https://developers.google.com/analytics/devguides/collection/protocol/v1/devguide#screenView # https://developers.google.com/analytics/devguides/collection/protocol/v1/parameters - curl https://www.google-analytics.com/collect -d v=1 \ + "$HOMEBREW_CURL" https://www.google-analytics.com/collect -d v=1 \ --silent --max-time 3 --output /dev/null \ --user-agent "$HOMEBREW_USER_AGENT_CURL" \ -d tid="$HOMEBREW_ANALYTICS_ID" \