aboutsummaryrefslogtreecommitdiffstats
path: root/Library
diff options
context:
space:
mode:
authorXu Cheng2015-06-02 15:30:56 +0800
committerXu Cheng2015-06-02 15:41:12 +0800
commit296ca615103a9b4b59519e4f0e3b75a6bc6f9b03 (patch)
tree2c65bd8cb91245feac91687ce2782267f05d63df /Library
parent45a71898e8f06caf334e3c6baefb974504681744 (diff)
downloadbrew-296ca615103a9b4b59519e4f0e3b75a6bc6f9b03.tar.bz2
test-bot: simplify the upload logic
If the bottle is already published, let's fail directly. Also silent the curl output. Closes Homebrew/homebrew#40295. Signed-off-by: Xu Cheng <xucheng@me.com>
Diffstat (limited to 'Library')
-rw-r--r--Library/Homebrew/cmd/test-bot.rb13
1 files changed, 9 insertions, 4 deletions
diff --git a/Library/Homebrew/cmd/test-bot.rb b/Library/Homebrew/cmd/test-bot.rb
index 65ba62381..f490fefe1 100644
--- a/Library/Homebrew/cmd/test-bot.rb
+++ b/Library/Homebrew/cmd/test-bot.rb
@@ -789,6 +789,14 @@ module Homebrew
version = formula.pkg_version
bintray_package = Bintray.package formula_name
+ if system "curl", "-I", "--silent", "--fail", "--output", "/dev/null",
+ "#{BottleSpecification::DEFAULT_DOMAIN}/#{bintray_repo}/#{filename}"
+ raise <<-EOS.undent
+ #{filename} is already published. Please remove it manually from
+ https://bintray.com/homebrew/#{bintray_repo}/#{bintray_package}/view#files
+ EOS
+ end
+
unless formula_packaged[formula_name]
package_url = "#{bintray_repo_url}/#{bintray_package}"
unless system "curl", "--silent", "--fail", "--output", "/dev/null", package_url
@@ -802,10 +810,7 @@ module Homebrew
content_url = "https://api.bintray.com/content/homebrew"
content_url += "/#{bintray_repo}/#{bintray_package}/#{version}/#{filename}"
- unless system "curl", "-I", "--fail", "--output", "/dev/null",
- "https://homebrew.bintray.com/#{bintray_repo}/#{filename}"
- content_url += "?override=1"
- end
+ content_url += "?override=1"
curl "--silent", "--fail", "-u#{bintray_user}:#{bintray_key}",
"-T", filename, content_url
puts