From e7aaeda953e84fdc1965fb27cc0af579224ed3a5 Mon Sep 17 00:00:00 2001 From: Charlie Sharpsteen Date: Tue, 4 Oct 2011 18:35:14 -0700 Subject: [PATCH] formula.rb: Don't attempt to mirror unstable URLs If a build is being influenced by an option such as `--HEAD`. Don't attempt mirrors if a download fails. Fixes Homebrew/homebrew#7971. --- Library/Homebrew/formula.rb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Library/Homebrew/formula.rb b/Library/Homebrew/formula.rb index 6143a4689b..c2aeec8de3 100644 --- a/Library/Homebrew/formula.rb +++ b/Library/Homebrew/formula.rb @@ -557,7 +557,9 @@ private # For brew-fetch and others. def fetch downloader = @downloader - mirror_list = mirrors + # Don't attempt mirrors if this install is not pointed at a "stable" URL. + # This can happen when options like `--HEAD` are invoked. + mirror_list = @spec_to_use == @stable ? mirrors : [] # Ensure the cache exists HOMEBREW_CACHE.mkpath