bintray: url encode where needed
This commit is contained in:
parent
b926eeb0d6
commit
65d7036c19
@ -106,12 +106,12 @@ class Bintray
|
||||
formula_packaged = {}
|
||||
|
||||
bottles_hash.each do |formula_name, bottle_hash|
|
||||
version = bottle_hash["formula"]["pkg_version"]
|
||||
version = ERB::Util.url_encode(bottle_hash["formula"]["pkg_version"])
|
||||
bintray_package = bottle_hash["bintray"]["package"]
|
||||
bintray_repo = bottle_hash["bintray"]["repository"]
|
||||
|
||||
bottle_hash["bottle"]["tags"].each do |_tag, tag_hash|
|
||||
filename = tag_hash["filename"]
|
||||
filename = tag_hash["filename"] # URL encoded in Bottle::Filename#bintray
|
||||
sha256 = tag_hash["sha256"]
|
||||
|
||||
odebug "Checking remote file #{@bintray_org}/#{bintray_repo}/#{filename}"
|
||||
@ -132,7 +132,7 @@ class Bintray
|
||||
formula_packaged[formula_name] = true
|
||||
end
|
||||
|
||||
odebug "Uploading #{@bintray_org}/#{bintray_repo}/#{bintray_package}/#{version}/#{tag_hash["local_filename"]}"
|
||||
odebug "Uploading #{@bintray_org}/#{bintray_repo}/#{bintray_package}/#{version}/#{filename}"
|
||||
upload(tag_hash["local_filename"],
|
||||
repo: bintray_repo,
|
||||
package: bintray_package,
|
||||
|
||||
@ -41,20 +41,21 @@ module Homebrew
|
||||
|
||||
downloader.fetch
|
||||
|
||||
filename = downloader.basename
|
||||
filename = ERB::Util.url_encode(downloader.basename)
|
||||
|
||||
destination_url = "https://dl.bintray.com/#{bintray_org}/#{bintray_repo}/#{filename}"
|
||||
ohai "Uploading to #{destination_url}"
|
||||
|
||||
version = ERB::Util.url_encode(f.pkg_version)
|
||||
bintray.upload(
|
||||
downloader.cached_location,
|
||||
repo: bintray_repo,
|
||||
package: bintray_package,
|
||||
version: f.pkg_version,
|
||||
version: version,
|
||||
sha256: f.stable.checksum,
|
||||
remote_file: filename,
|
||||
)
|
||||
bintray.publish(repo: bintray_repo, package: bintray_package, version: f.pkg_version)
|
||||
bintray.publish(repo: bintray_repo, package: bintray_package, version: version)
|
||||
ohai "Mirrored #{filename}!"
|
||||
end
|
||||
end
|
||||
|
||||
@ -274,7 +274,7 @@ class Bottle
|
||||
end
|
||||
|
||||
def bintray
|
||||
"#{name}-#{version}#{extname}"
|
||||
ERB::Util.url_encode("#{name}-#{version}#{extname}")
|
||||
end
|
||||
|
||||
def extname
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user