diff options
| author | jainish shah | 2016-07-13 11:43:43 +0100 |
|---|---|---|
| committer | Mike McQuaid | 2016-07-13 11:45:15 +0100 |
| commit | 48a1e1b47fecdde0127274a55e85312dbf268164 (patch) | |
| tree | abe52db31e7faa8619261304a459b71965956e5b | |
| parent | b586a04204cbaa5e4e3986a3f274bc0c4201db91 (diff) | |
| download | brew-48a1e1b47fecdde0127274a55e85312dbf268164.tar.bz2 | |
Add HOMEBREW_ARTIFACT_DOMAIN option.
If set, this environment variable instructs Homebrew to use the given URL as a
download mirror (e.g. an Artifactory instance) for bottles and binaries.
Closes #387.
Signed-off-by: Mike McQuaid <mike@mikemcquaid.com>
| -rw-r--r-- | Library/Homebrew/download_strategy.rb | 5 | ||||
| -rw-r--r-- | Library/Homebrew/manpages/brew.1.md.erb | 3 | ||||
| -rw-r--r-- | share/doc/homebrew/brew.1.html | 1 | ||||
| -rw-r--r-- | share/man/man1/brew.1 | 4 |
4 files changed, 13 insertions, 0 deletions
diff --git a/Library/Homebrew/download_strategy.rb b/Library/Homebrew/download_strategy.rb index 4cb1a185a..ec060cef0 100644 --- a/Library/Homebrew/download_strategy.rb +++ b/Library/Homebrew/download_strategy.rb @@ -330,6 +330,11 @@ class CurlDownloadStrategy < AbstractFileDownloadStrategy # Private method, can be overridden if needed. def _fetch + if ENV["HOMEBREW_ARTIFACT_DOMAIN"] + @url.sub!(%r{^((ht|f)tps?://)?}, ENV["HOMEBREW_ARTIFACT_DOMAIN"].chomp("/") + "/") + ohai "Downloading from #{@url}" + end + urls = actual_urls unless urls.empty? ohai "Downloading from #{urls.last}" diff --git a/Library/Homebrew/manpages/brew.1.md.erb b/Library/Homebrew/manpages/brew.1.md.erb index 21fc4f81a..affac9295 100644 --- a/Library/Homebrew/manpages/brew.1.md.erb +++ b/Library/Homebrew/manpages/brew.1.md.erb @@ -105,6 +105,9 @@ can take several different forms: * `HOMEBREW_BOTTLE_DOMAIN`: If set, instructs Homebrew to use the given URL as a download mirror for bottles. + * `HOMEBREW_ARTIFACT_DOMAIN`: + If set, instructs Homebrew to use the given URL as a download mirror for bottles and binaries. + * `HOMEBREW_BROWSER`: If set, uses this setting as the browser when opening project homepages, instead of the OS default browser. diff --git a/share/doc/homebrew/brew.1.html b/share/doc/homebrew/brew.1.html index 5951ade59..007edd11c 100644 --- a/share/doc/homebrew/brew.1.html +++ b/share/doc/homebrew/brew.1.html @@ -518,6 +518,7 @@ a Homebrew-built Git if installed, or the system-provided binary.</p> <p>Set this to force Homebrew to use a particular git binary.</p></dd> <dt><code>HOMEBREW_BOTTLE_DOMAIN</code></dt><dd><p>If set, instructs Homebrew to use the given URL as a download mirror for bottles.</p></dd> +<dt><code>HOMEBREW_ARTIFACT_DOMAIN</code></dt><dd><p>If set, instructs Homebrew to use the given URL as a download mirror for bottles and binaries.</p></dd> <dt><code>HOMEBREW_BROWSER</code></dt><dd><p>If set, uses this setting as the browser when opening project homepages, instead of the OS default browser.</p></dd> <dt><code>HOMEBREW_BUILD_FROM_SOURCE</code></dt><dd><p>If set, instructs Homebrew to compile from source even when a formula diff --git a/share/man/man1/brew.1 b/share/man/man1/brew.1 index d7172aad9..b235f7662 100644 --- a/share/man/man1/brew.1 +++ b/share/man/man1/brew.1 @@ -715,6 +715,10 @@ Set this to force Homebrew to use a particular git binary\. If set, instructs Homebrew to use the given URL as a download mirror for bottles\. . .TP +\fBHOMEBREW_ARTIFACT_DOMAIN\fR +If set, instructs Homebrew to use the given URL as a download mirror for bottles and binaries\. +. +.TP \fBHOMEBREW_BROWSER\fR If set, uses this setting as the browser when opening project homepages, instead of the OS default browser\. . |
