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.
This commit is contained in:
Charlie Sharpsteen 2011-10-04 18:35:14 -07:00
parent bcea01ca0a
commit e7aaeda953

View File

@ -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