Skip to content

Commit

Permalink
Fix brew update user agent.
Browse files Browse the repository at this point in the history
This needs to be `Homebrew $HOMEBREW_VERSION` so we can be adequately
filtered.

Closes Homebrew#49961.

Signed-off-by: Mike McQuaid <mike@mikemcquaid.com>
  • Loading branch information
MikeMcQuaid committed Mar 10, 2016
1 parent 626169d commit 397c202
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
5 changes: 3 additions & 2 deletions Library/Homebrew/cmd/update.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion Library/Homebrew/global.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

ARGV.extend(HomebrewArgvExtension)

HOMEBREW_VERSION = "0.9.5"
HOMEBREW_VERSION = ENV["HOMEBREW_VERSION"]
HOMEBREW_WWW = "http://brew.sh"

require "config"
Expand Down
3 changes: 3 additions & 0 deletions Library/brew.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
HOMEBREW_VERSION="0.9.5"

odie() {
if [[ -t 2 ]] # check whether stderr is a tty.
then
Expand Down Expand Up @@ -70,6 +72,7 @@ then
fi
fi

export HOMEBREW_VERSION
export HOMEBREW_BREW_FILE
export HOMEBREW_RUBY_PATH
export HOMEBREW_PREFIX
Expand Down

0 comments on commit 397c202

Please sign in to comment.