From 9c46e4be0a08fd86be107e0bdd59c4dfd645ca18 Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Thu, 9 Apr 2015 20:52:49 +0200 Subject: [PATCH] download_strategy: automatically use apache.org https mirror Discussion: https://github.com/Homebrew/homebrew/issues/37945 Patch by @jacknagel. Closes Homebrew/homebrew#38492. Signed-off-by: Mike McQuaid --- Library/Homebrew/download_strategy.rb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Library/Homebrew/download_strategy.rb b/Library/Homebrew/download_strategy.rb index 72a64bdd28..589147c316 100644 --- a/Library/Homebrew/download_strategy.rb +++ b/Library/Homebrew/download_strategy.rb @@ -343,7 +343,9 @@ class CurlApacheMirrorDownloadStrategy < CurlDownloadStrategy @tried_apache_mirror = true mirrors = Utils::JSON.load(apache_mirrors) - @url = mirrors.fetch('preferred') + mirrors.fetch('path_info') + path_info = mirrors.fetch("path_info") + @url = mirrors.fetch('preferred') + path_info + @mirrors |= %W[https://archive.apache.org/dist/#{path_info}] ohai "Best Mirror #{@url}" super