fetch: fall back to source if bottle fails.

This matches the behaviour when `brew install`ing formulae.

Closes Homebrew/homebrew#46490.

Closes Homebrew/homebrew#46619.

Signed-off-by: Mike McQuaid <mike@mikemcquaid.com>
This commit is contained in:
Mike McQuaid 2015-12-03 11:00:39 +02:00
parent 98fbcb7299
commit 17e5c1409f

View File

@ -19,9 +19,21 @@ module Homebrew
bucket.each do |f| bucket.each do |f|
f.print_tap_action :verb => "Fetching" f.print_tap_action :verb => "Fetching"
fetched_bottle = false
if fetch_bottle?(f) if fetch_bottle?(f)
begin
fetch_formula(f.bottle) fetch_formula(f.bottle)
rescue Exception => e
raise if ARGV.homebrew_developer? || e.is_a?(Interrupt)
fetched_bottle = false
onoe e.message
opoo "Bottle fetch failed: fetching the source."
else else
fetched_bottle = true
end
end
unless fetched_bottle
fetch_formula(f) fetch_formula(f)
f.resources.each { |r| fetch_resource(r) } f.resources.each { |r| fetch_resource(r) }
f.patchlist.each { |p| fetch_patch(p) if p.external? } f.patchlist.each { |p| fetch_patch(p) if p.external? }