aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorXu Cheng2015-07-03 22:59:30 +0800
committerXu Cheng2015-07-06 18:05:00 +0800
commitab9a62370fc024b344a72306b92aa981c40a3467 (patch)
tree8ed855005a1bebd055ec07262ddb87839927ba9b
parent4443a875243cabb0afaa862c846816b9e50fe60c (diff)
downloadbrew-ab9a62370fc024b344a72306b92aa981c40a3467.tar.bz2
support downloading bottles through 3rd-party mirror
Closes Homebrew/homebrew#41328. Closes Homebrew/homebrew#41332. Signed-off-by: Xu Cheng <xucheng@me.com>
-rw-r--r--Library/Homebrew/cmd/config.rb2
-rw-r--r--Library/Homebrew/manpages/brew.1.md5
-rw-r--r--Library/Homebrew/software_spec.rb2
-rw-r--r--share/man/man1/brew.14
4 files changed, 11 insertions, 2 deletions
diff --git a/Library/Homebrew/cmd/config.rb b/Library/Homebrew/cmd/config.rb
index 3f36125f6..d3f00555c 100644
--- a/Library/Homebrew/cmd/config.rb
+++ b/Library/Homebrew/cmd/config.rb
@@ -1,4 +1,5 @@
require 'hardware'
+require "software_spec"
module Homebrew
def config
@@ -137,6 +138,7 @@ module Homebrew
f.puts "Last commit: #{last_commit}"
f.puts "HOMEBREW_PREFIX: #{HOMEBREW_PREFIX}"
f.puts "HOMEBREW_CELLAR: #{HOMEBREW_CELLAR}"
+ f.puts "HOMEBREW_BOTTLE_DOMAIN: #{BottleSpecification::DEFAULT_DOMAIN}"
f.puts hardware
f.puts "OS X: #{MACOS_FULL_VERSION}-#{kernel}"
f.puts "Xcode: #{xcode ? xcode : "N/A"}"
diff --git a/Library/Homebrew/manpages/brew.1.md b/Library/Homebrew/manpages/brew.1.md
index 65d8beee0..3281f148d 100644
--- a/Library/Homebrew/manpages/brew.1.md
+++ b/Library/Homebrew/manpages/brew.1.md
@@ -540,7 +540,10 @@ can take several different forms:
Set this to force Homebrew to use a particular git binary.
- * HOMEBREW_BROWSER:
+ * HOMEBREW\_BOTTLE\_DOMAIN:
+ If set, instructs Homebrew to use the given URL as a download mirror for bottles.
+
+ * HOMEBREW\_BROWSER:
If set, uses this setting as the browser when opening project homepages,
instead of the OS default browser.
diff --git a/Library/Homebrew/software_spec.rb b/Library/Homebrew/software_spec.rb
index 9ace95e21..b30f489d2 100644
--- a/Library/Homebrew/software_spec.rb
+++ b/Library/Homebrew/software_spec.rb
@@ -259,7 +259,7 @@ end
class BottleSpecification
DEFAULT_PREFIX = "/usr/local".freeze
DEFAULT_CELLAR = "/usr/local/Cellar".freeze
- DEFAULT_DOMAIN = "https://homebrew.bintray.com".freeze
+ DEFAULT_DOMAIN = (ENV["HOMEBREW_BOTTLE_DOMAIN"] || "https://homebrew.bintray.com").freeze
attr_rw :prefix, :cellar, :revision
attr_accessor :tap
diff --git a/share/man/man1/brew.1 b/share/man/man1/brew.1
index a880e64e6..cfd85264a 100644
--- a/share/man/man1/brew.1
+++ b/share/man/man1/brew.1
@@ -507,6 +507,10 @@ When using Git, Homebrew will use \fBGIT\fR if set, a Homebrew\-built Git if ins
Set this to force Homebrew to use a particular git binary\.
.
.TP
+HOMEBREW_BOTTLE_DOMAIN
+If set, instructs Homebrew to use the given URL as a download mirror for bottles\.
+.
+.TP
HOMEBREW_BROWSER
If set, uses this setting as the browser when opening project homepages, instead of the OS default browser\.
.