api: add using: attribute to head & stable URLs

This commit is contained in:
Eric Knibbe 2023-10-11 09:47:15 -04:00
parent f89c7194e8
commit 03e743a75e
No known key found for this signature in database
GPG Key ID: 179D9CDDDB814168
2 changed files with 11 additions and 2 deletions

View File

@ -2281,6 +2281,7 @@ class Formula
"url" => stable_spec.url,
"tag" => stable_spec.specs[:tag],
"revision" => stable_spec.specs[:revision],
"using" => (stable_spec.using if stable_spec.using.is_a?(Symbol)),
"checksum" => stable_spec.checksum&.to_s,
}
@ -2291,6 +2292,7 @@ class Formula
hsh["urls"]["head"] = {
"url" => T.must(head).url,
"branch" => T.must(head).specs[:branch],
"using" => (T.must(head).using if T.must(head).using.is_a?(Symbol)),
}
end

View File

@ -241,7 +241,11 @@ module Formulary
if (urls_stable = json_formula["urls"]["stable"].presence)
stable do
url_spec = { tag: urls_stable["tag"], revision: urls_stable["revision"] }.compact
url_spec = {
tag: urls_stable["tag"],
revision: urls_stable["revision"],
using: urls_stable["using"]&.to_sym,
}.compact
url urls_stable["url"], **url_spec
version json_formula["versions"]["stable"]
sha256 urls_stable["checksum"] if urls_stable["checksum"].present?
@ -256,7 +260,10 @@ module Formulary
if (urls_head = json_formula["urls"]["head"].presence)
head do
url_spec = { branch: urls_head["branch"] }.compact
url_spec = {
branch: urls_head["branch"],
using: urls_head["using"]&.to_sym,
}.compact
url urls_head["url"], **url_spec
instance_exec(:head, &add_deps)