Rename download_bottles to fetch_bottles

This commit is contained in:
Rylan Polster 2021-07-05 10:49:19 -04:00
parent 22f986b89a
commit 36dd69dd60
No known key found for this signature in database
GPG Key ID: 46A744940CFF4D64
4 changed files with 6 additions and 8 deletions

View File

@ -125,7 +125,7 @@ module Homebrew
rescue NoSuchKegError, FormulaUnavailableError => e
if load_from_json && ENV["HOMEBREW_JSON_CORE"].present? && !CoreTap.instance.installed? &&
Utils::BottleAPI.bottle_available?(name)
Utils::BottleAPI.download_bottles(name)
Utils::BottleAPI.fetch_bottles(name)
retry
end

View File

@ -91,7 +91,7 @@ module Homebrew
next if formula.tap.present? && !formula.tap.installed?
next unless Utils::BottleAPI.bottle_available?(name)
Utils::BottleAPI.download_bottles(name)
Utils::BottleAPI.fetch_bottles(name)
rescue FormulaUnavailableError
next
end

View File

@ -164,15 +164,13 @@ module Homebrew
next formula if formula.tap.present? && formula.tap.installed?
next formula unless Utils::BottleAPI.bottle_available?(formula.name)
Utils::BottleAPI.download_bottles(formula.name)
Utils::BottleAPI.fetch_bottles(formula.name)
Formulary.factory(formula.name)
rescue FormulaUnavailableError
formula
end
end
opoo formulae_to_install
if formulae_to_install.empty?
oh1 "No packages to upgrade"
else

View File

@ -19,7 +19,7 @@ module Utils
end.freeze
FORMULAE_BREW_SH_VERSIONS_API_URL = if OS.mac?
"https://formulae.brew.sh/api/versions.json"
"https://formulae.brew.sh/api/versions-formulae.json"
else
"https://formulae.brew.sh/api/versions-linux.json"
end.freeze
@ -58,11 +58,11 @@ module Utils
end
sig { params(name: String).void }
def download_bottles(name)
def fetch_bottles(name)
hash = fetch(name)
bottle_tag = Utils::Bottles.tag.to_s
odie "No bottle availabe for current OS" unless hash["bottles"].key? bottle_tag
odie "No bottle available for current OS" unless hash["bottles"].key? bottle_tag
download_bottle(hash, bottle_tag)