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