Merge pull request #11025 from sjackman/sj/ghcr-third-party-tap
CurlGitHubPackagesDownloadStrategy: Fix third-party taps
This commit is contained in:
commit
77a53d6730
@ -306,9 +306,7 @@ class Bottle
|
|||||||
|
|
||||||
filename = Filename.create(formula, tag, spec.rebuild).bintray
|
filename = Filename.create(formula, tag, spec.rebuild).bintray
|
||||||
|
|
||||||
# TODO: this will need adjusted when if we use GitHub Packages by default
|
path, resolved_basename = if spec.root_url.match?(GitHubPackages::URL_REGEX)
|
||||||
path, resolved_basename = if (bottle_domain = Homebrew::EnvConfig.bottle_domain.presence) &&
|
|
||||||
bottle_domain.start_with?(GitHubPackages::URL_PREFIX)
|
|
||||||
["#{@name}/blobs/sha256:#{checksum}", filename]
|
["#{@name}/blobs/sha256:#{checksum}", filename]
|
||||||
else
|
else
|
||||||
filename
|
filename
|
||||||
@ -443,13 +441,18 @@ class BottleSpecification
|
|||||||
|
|
||||||
def root_url(var = nil, specs = {})
|
def root_url(var = nil, specs = {})
|
||||||
if var.nil?
|
if var.nil?
|
||||||
@root_url ||= if Homebrew::EnvConfig.bottle_domain.start_with?(GitHubPackages::URL_PREFIX)
|
@root_url ||= if Homebrew::EnvConfig.bottle_domain.match?(GitHubPackages::URL_REGEX)
|
||||||
GitHubPackages.root_url(tap.user, tap.repo).to_s
|
GitHubPackages.root_url(tap.user, tap.repo).to_s
|
||||||
else
|
else
|
||||||
"#{Homebrew::EnvConfig.bottle_domain}/#{Utils::Bottles::Bintray.repository(tap)}"
|
"#{Homebrew::EnvConfig.bottle_domain}/#{Utils::Bottles::Bintray.repository(tap)}"
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
@root_url = var
|
@root_url = if var.to_s.start_with? "docker://"
|
||||||
|
_, registry, org, repo = *var.match(%r{docker://([\w.-]+)/([\w-]+)/([\w-]+)})
|
||||||
|
GitHubPackages.root_url(org, repo, "https://#{registry}/v2/").to_s
|
||||||
|
else
|
||||||
|
var
|
||||||
|
end
|
||||||
@root_url_specs.merge!(specs)
|
@root_url_specs.merge!(specs)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user