Fix brew update
user agent.
This needs to be `Homebrew $HOMEBREW_VERSION` so we can be adequately filtered. Closes Homebrew/homebrew#49961. Signed-off-by: Mike McQuaid <mike@mikemcquaid.com>
This commit is contained in:
parent
c8debd8fa4
commit
2c3a7e8c75
@ -342,8 +342,9 @@ EOS
|
|||||||
# (so the API does not return 304: unmodified).
|
# (so the API does not return 304: unmodified).
|
||||||
UPSTREAM_SHA_HTTP_CODE="$(curl --silent '--max-time' 3 \
|
UPSTREAM_SHA_HTTP_CODE="$(curl --silent '--max-time' 3 \
|
||||||
--output /dev/null --write-out "%{http_code}" \
|
--output /dev/null --write-out "%{http_code}" \
|
||||||
-H "Accept: application/vnd.github.chitauri-preview+sha" \
|
--user-agent "Homebrew $HOMEBREW_VERSION" \
|
||||||
-H "If-None-Match: \"$UPSTREAM_BRANCH_LOCAL_SHA\"" \
|
--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")"
|
"https://api.github.com/repos/$UPSTREAM_REPOSITORY/commits/$UPSTREAM_BRANCH")"
|
||||||
[[ "$UPSTREAM_SHA_HTTP_CODE" = "304" ]] && exit
|
[[ "$UPSTREAM_SHA_HTTP_CODE" = "304" ]] && exit
|
||||||
fi
|
fi
|
||||||
|
@ -12,7 +12,7 @@ require "rbconfig"
|
|||||||
|
|
||||||
ARGV.extend(HomebrewArgvExtension)
|
ARGV.extend(HomebrewArgvExtension)
|
||||||
|
|
||||||
HOMEBREW_VERSION = "0.9.5"
|
HOMEBREW_VERSION = ENV["HOMEBREW_VERSION"]
|
||||||
HOMEBREW_WWW = "http://brew.sh"
|
HOMEBREW_WWW = "http://brew.sh"
|
||||||
|
|
||||||
require "config"
|
require "config"
|
||||||
|
@ -1,3 +1,5 @@
|
|||||||
|
HOMEBREW_VERSION="0.9.5"
|
||||||
|
|
||||||
odie() {
|
odie() {
|
||||||
if [[ -t 2 ]] # check whether stderr is a tty.
|
if [[ -t 2 ]] # check whether stderr is a tty.
|
||||||
then
|
then
|
||||||
@ -70,6 +72,7 @@ then
|
|||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
export HOMEBREW_VERSION
|
||||||
export HOMEBREW_BREW_FILE
|
export HOMEBREW_BREW_FILE
|
||||||
export HOMEBREW_RUBY_PATH
|
export HOMEBREW_RUBY_PATH
|
||||||
export HOMEBREW_PREFIX
|
export HOMEBREW_PREFIX
|
||||||
|
Loading…
x
Reference in New Issue
Block a user