Fix brew mirror.

This commit is contained in:
Markus Reiter 2018-10-01 10:19:55 +02:00
parent fe2f909417
commit a37c02982e
2 changed files with 12 additions and 8 deletions

View File

@ -38,17 +38,20 @@ module Homebrew
puts
end
download = f.fetch
f.verify_download_integrity(download)
filename = download.basename
destination_url = "https://dl.bintray.com/homebrew/mirror/#{filename}"
downloader = f.downloader
downloader.fetch
f.verify_download_integrity(downloader.cached_location)
filename = downloader.basename
destination_url = "https://dl.bintray.com/homebrew/mirror/#{filename}"
ohai "Uploading to #{destination_url}"
content_url = "https://api.bintray.com/content/homebrew/mirror"
content_url += "/#{bintray_package}/#{f.pkg_version}/#{filename}"
content_url += "?publish=1"
content_url =
"https://api.bintray.com/content/homebrew/mirror/#{bintray_package}/#{f.pkg_version}/#{filename}?publish=1"
curl "--silent", "--fail", "--user", "#{bintray_user}:#{bintray_key}",
"--upload-file", download, content_url
"--upload-file", downloader.cached_location, content_url
puts
ohai "Mirrored #{filename}!"
end

View File

@ -333,6 +333,7 @@ class Formula
:bottle_defined?,
:bottled?,
:bottle_specification,
:downloader,
] => :active_spec
# The Bottle object for the currently active {SoftwareSpec}.