Merge pull request #4389 from MikeMcQuaid/bintray-portable-ruby

portable-ruby: respect HOMEBREW_BOTTLE_DOMAIN variable.
This commit is contained in:
Mike McQuaid 2018-06-29 20:07:11 +01:00 committed by GitHub
commit 1bf3aacc79
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 16 additions and 6 deletions

View File

@ -274,6 +274,12 @@ then
export HOMEBREW_RUBY_WARNINGS="-W0" export HOMEBREW_RUBY_WARNINGS="-W0"
fi fi
export HOMEBREW_BOTTLE_DEFAULT_DOMAIN="https://homebrew.bintray.com"
if [[ -z "$HOMEBREW_BOTTLE_DOMAIN" ]]
then
export HOMEBREW_BOTTLE_DOMAIN="$HOMEBREW_BOTTLE_DEFAULT_DOMAIN"
fi
if [[ -f "$HOMEBREW_LIBRARY/Homebrew/cmd/$HOMEBREW_COMMAND.sh" ]] if [[ -f "$HOMEBREW_LIBRARY/Homebrew/cmd/$HOMEBREW_COMMAND.sh" ]]
then then
HOMEBREW_BASH_COMMAND="$HOMEBREW_LIBRARY/Homebrew/cmd/$HOMEBREW_COMMAND.sh" HOMEBREW_BASH_COMMAND="$HOMEBREW_LIBRARY/Homebrew/cmd/$HOMEBREW_COMMAND.sh"

View File

@ -13,7 +13,7 @@ if [[ -n "$HOMEBREW_MACOS" ]]
then then
if [[ "$HOMEBREW_PROCESSOR" = "Intel" ]] if [[ "$HOMEBREW_PROCESSOR" = "Intel" ]]
then then
ruby_URL="https://homebrew.bintray.com/bottles-portable-ruby/portable-ruby-2.3.3_2.leopard_64.bottle.tar.gz" ruby_URL="$HOMEBREW_BOTTLE_DOMAIN/bottles-portable-ruby/portable-ruby-2.3.3_2.leopard_64.bottle.tar.gz"
ruby_URL2="https://github.com/Homebrew/homebrew-portable-ruby/releases/download/2.3.3_2/portable-ruby-2.3.3_2.leopard_64.bottle.tar.gz" ruby_URL2="https://github.com/Homebrew/homebrew-portable-ruby/releases/download/2.3.3_2/portable-ruby-2.3.3_2.leopard_64.bottle.tar.gz"
ruby_SHA="f1db8863543d256e6a8e704bf618025030b3d22a7a6b19749d19f599b5554212" ruby_SHA="f1db8863543d256e6a8e704bf618025030b3d22a7a6b19749d19f599b5554212"
fi fi
@ -21,12 +21,12 @@ elif [[ -n "$HOMEBREW_LINUX" ]]
then then
case "$HOMEBREW_PROCESSOR" in case "$HOMEBREW_PROCESSOR" in
x86_64) x86_64)
ruby_URL="https://homebrew.bintray.com/bottles-portable-ruby/portable-ruby-2.3.3_2.x86_64_linux.bottle.tar.gz" ruby_URL="$HOMEBREW_BOTTLE_DOMAIN/bottles-portable-ruby/portable-ruby-2.3.3_2.x86_64_linux.bottle.tar.gz"
ruby_URL2="https://github.com/Homebrew/homebrew-portable-ruby/releases/download/2.3.3_2/portable-ruby-2.3.3_2.x86_64_linux.bottle.tar.gz" ruby_URL2="https://github.com/Homebrew/homebrew-portable-ruby/releases/download/2.3.3_2/portable-ruby-2.3.3_2.x86_64_linux.bottle.tar.gz"
ruby_SHA="b5c320c1bc2c4d42d4674643855c582ba2772fc951689d298ee079b74bac29a7" ruby_SHA="b5c320c1bc2c4d42d4674643855c582ba2772fc951689d298ee079b74bac29a7"
;; ;;
armv[67]*) armv[67]*)
ruby_URL="https://homebrew.bintray.com/bottles-portable-ruby/portable-ruby-2.3.3_2.armv6_linux.bottle.tar.gz" ruby_URL="$HOMEBREW_BOTTLE_DOMAIN/bottles-portable-ruby/portable-ruby-2.3.3_2.armv6_linux.bottle.tar.gz"
ruby_URL2="https://github.com/Homebrew/homebrew-portable-ruby/releases/download/2.3.3_2/portable-ruby-2.3.3_2.armv6_linux.bottle.tar.gz" ruby_URL2="https://github.com/Homebrew/homebrew-portable-ruby/releases/download/2.3.3_2/portable-ruby-2.3.3_2.armv6_linux.bottle.tar.gz"
ruby_SHA="6ac992c4620912b50b3c74f2d4447d541bac4f1839e557c3edcfdebb141c9802" ruby_SHA="6ac992c4620912b50b3c74f2d4447d541bac4f1839e557c3edcfdebb141c9802"
;; ;;

View File

@ -42,7 +42,7 @@ require "erb"
BOTTLE_ERB = <<-EOS.freeze BOTTLE_ERB = <<-EOS.freeze
bottle do bottle do
<% if !root_url.start_with?(BottleSpecification::DEFAULT_DOMAIN) %> <% if !root_url.start_with?(HOMEBREW_BOTTLE_DEFAULT_DOMAIN) %>
root_url "<%= root_url %>" root_url "<%= root_url %>"
<% end %> <% end %>
<% if prefix != BottleSpecification::DEFAULT_PREFIX %> <% if prefix != BottleSpecification::DEFAULT_PREFIX %>

View File

@ -25,6 +25,9 @@ HOMEBREW_USER_AGENT_CURL = ENV["HOMEBREW_USER_AGENT_CURL"]
HOMEBREW_USER_AGENT_RUBY = "#{ENV["HOMEBREW_USER_AGENT"]} ruby/#{RUBY_VERSION}-p#{RUBY_PATCHLEVEL}".freeze HOMEBREW_USER_AGENT_RUBY = "#{ENV["HOMEBREW_USER_AGENT"]} ruby/#{RUBY_VERSION}-p#{RUBY_PATCHLEVEL}".freeze
HOMEBREW_USER_AGENT_FAKE_SAFARI = "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_3) AppleWebKit/602.4.8 (KHTML, like Gecko) Version/10.0.3 Safari/602.4.8".freeze HOMEBREW_USER_AGENT_FAKE_SAFARI = "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_3) AppleWebKit/602.4.8 (KHTML, like Gecko) Version/10.0.3 Safari/602.4.8".freeze
HOMEBREW_BOTTLE_DEFAULT_DOMAIN = ENV["HOMEBREW_BOTTLE_DEFAULT_DOMAIN"]
HOMEBREW_BOTTLE_DOMAIN = ENV["HOMEBREW_BOTTLE_DOMAIN"]
require "extend/fileutils" require "extend/fileutils"
module Homebrew module Homebrew

View File

@ -327,7 +327,6 @@ end
class BottleSpecification class BottleSpecification
DEFAULT_PREFIX = "/usr/local".freeze DEFAULT_PREFIX = "/usr/local".freeze
DEFAULT_CELLAR = "/usr/local/Cellar".freeze DEFAULT_CELLAR = "/usr/local/Cellar".freeze
DEFAULT_DOMAIN = (ENV["HOMEBREW_BOTTLE_DOMAIN"] || "https://homebrew.bintray.com").freeze
attr_rw :prefix, :cellar, :rebuild attr_rw :prefix, :cellar, :rebuild
attr_accessor :tap attr_accessor :tap
@ -343,7 +342,7 @@ class BottleSpecification
def root_url(var = nil, specs = {}) def root_url(var = nil, specs = {})
if var.nil? if var.nil?
@root_url ||= "#{DEFAULT_DOMAIN}/#{Utils::Bottles::Bintray.repository(tap)}" @root_url ||= "#{HOMEBREW_BOTTLE_DOMAIN}/#{Utils::Bottles::Bintray.repository(tap)}"
else else
@root_url = var @root_url = var
@root_url_specs.merge!(specs) @root_url_specs.merge!(specs)

View File

@ -124,6 +124,8 @@ class SystemConfig
HOMEBREW_ANALYTICS_ID HOMEBREW_ANALYTICS_ID
HOMEBREW_ANALYTICS_USER_UUID HOMEBREW_ANALYTICS_USER_UUID
HOMEBREW_AUTO_UPDATE_CHECKED HOMEBREW_AUTO_UPDATE_CHECKED
HOMEBREW_BOTTLE_DEFAULT_DOMAIN
HOMEBREW_BOTTLE_DOMAIN
HOMEBREW_BREW_FILE HOMEBREW_BREW_FILE
HOMEBREW_COMMAND_DEPTH HOMEBREW_COMMAND_DEPTH
HOMEBREW_CURL HOMEBREW_CURL