From eff70115b5eb20542c7d66725e1812cb0e149ff3 Mon Sep 17 00:00:00 2001 From: Mike McQuaid Date: Fri, 27 Jan 2017 09:36:47 +0000 Subject: [PATCH] pull: better handle missing bottles. If we make a PR in which we're building many formulae (e.g. https://github.com/Homebrew/homebrew-core/pull/9249) then we may want to pull those that built and publish their bottles and discard those that did not. Instead of saying bottles will be published when they won't and then blowing up just avoid publishing them and print a warning instead. --- Library/Homebrew/dev-cmd/pull.rb | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Library/Homebrew/dev-cmd/pull.rb b/Library/Homebrew/dev-cmd/pull.rb index f7006baaa9..8771788e4c 100644 --- a/Library/Homebrew/dev-cmd/pull.rb +++ b/Library/Homebrew/dev-cmd/pull.rb @@ -248,7 +248,6 @@ module Homebrew changed_formulae_names.each do |name| f = Formula[name] next if f.bottle_unneeded? || f.bottle_disabled? - ohai "Publishing on Bintray: #{f.name} #{f.pkg_version}" publish_bottle_file_on_bintray(f, bintray_creds) published << f.full_name end @@ -408,7 +407,12 @@ module Homebrew if info.nil? raise "Failed publishing bottle: failed reading formula info for #{f.full_name}" end + unless info.bottle_info_any + opoo "No bottle defined in formula #{package}" + return + end version = info.pkg_version + ohai "Publishing on Bintray: #{package} #{version}" curl "-w", '\n', "--silent", "--fail", "-u#{creds[:user]}:#{creds[:key]}", "-X", "POST", "-H", "Content-Type: application/json",