From 913659efe4ac5092ce69aebc0e0dc8ae7b16ba96 Mon Sep 17 00:00:00 2001 From: Mike McQuaid Date: Fri, 10 Jul 2015 16:11:51 +0100 Subject: [PATCH] pull: wait for Bintray publish, don't sleep. Closes Homebrew/homebrew#41530. Signed-off-by: Mike McQuaid --- Library/Homebrew/cmd/pull.rb | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/Library/Homebrew/cmd/pull.rb b/Library/Homebrew/cmd/pull.rb index c5ccac69c5..47529b3ec0 100644 --- a/Library/Homebrew/cmd/pull.rb +++ b/Library/Homebrew/cmd/pull.rb @@ -185,12 +185,16 @@ module Homebrew ohai "Publishing on Bintray:" package = Bintray.package f.name version = f.pkg_version - curl "--silent", "--fail", + curl "-w", '\n', "--silent", "--fail", "-u#{bintray_user}:#{bintray_key}", "-X", "POST", + "-d", '{"publish_wait_for_secs": -1}', "https://api.bintray.com/content/homebrew/#{repo}/#{package}/#{version}/publish" - puts - sleep 20 - safe_system "brew", "fetch", "--retry", "--force-bottle", f.full_name + success = system "brew", "fetch", "--retry", "--force-bottle", f.full_name + unless success + ohai "That didn't work; waiting for 15 seconds and trying again..." + sleep 15 + system "brew", "fetch", "--retry", "--force-bottle", f.full_name + end end else opoo "You must set BINTRAY_USER and BINTRAY_KEY to add or update bottles on Bintray!"