aboutsummaryrefslogtreecommitdiffstats
path: root/Library
diff options
context:
space:
mode:
Diffstat (limited to 'Library')
-rw-r--r--Library/Homebrew/cmd/update.sh5
-rw-r--r--Library/Homebrew/global.rb2
-rw-r--r--Library/brew.sh3
3 files changed, 7 insertions, 3 deletions
diff --git a/Library/Homebrew/cmd/update.sh b/Library/Homebrew/cmd/update.sh
index 13bce9909..49df783f2 100644
--- a/Library/Homebrew/cmd/update.sh
+++ b/Library/Homebrew/cmd/update.sh
@@ -342,8 +342,9 @@ EOS
# (so the API does not return 304: unmodified).
UPSTREAM_SHA_HTTP_CODE="$(curl --silent '--max-time' 3 \
--output /dev/null --write-out "%{http_code}" \
- -H "Accept: application/vnd.github.chitauri-preview+sha" \
- -H "If-None-Match: \"$UPSTREAM_BRANCH_LOCAL_SHA\"" \
+ --user-agent "Homebrew $HOMEBREW_VERSION" \
+ --header "Accept: application/vnd.github.chitauri-preview+sha" \
+ --header "If-None-Match: \"$UPSTREAM_BRANCH_LOCAL_SHA\"" \
"https://api.github.com/repos/$UPSTREAM_REPOSITORY/commits/$UPSTREAM_BRANCH")"
[[ "$UPSTREAM_SHA_HTTP_CODE" = "304" ]] && exit
fi
diff --git a/Library/Homebrew/global.rb b/Library/Homebrew/global.rb
index c8fec75e4..a4da2b86d 100644
--- a/Library/Homebrew/global.rb
+++ b/Library/Homebrew/global.rb
@@ -12,7 +12,7 @@ require "rbconfig"
ARGV.extend(HomebrewArgvExtension)
-HOMEBREW_VERSION = "0.9.5"
+HOMEBREW_VERSION = ENV["HOMEBREW_VERSION"]
HOMEBREW_WWW = "http://brew.sh"
require "config"
diff --git a/Library/brew.sh b/Library/brew.sh
index f840660b6..157f52ace 100644
--- a/Library/brew.sh
+++ b/Library/brew.sh
@@ -1,3 +1,5 @@
+HOMEBREW_VERSION="0.9.5"
+
odie() {
if [[ -t 2 ]] # check whether stderr is a tty.
then
@@ -70,6 +72,7 @@ then
fi
fi
+export HOMEBREW_VERSION
export HOMEBREW_BREW_FILE
export HOMEBREW_RUBY_PATH
export HOMEBREW_PREFIX