Fix tests

This commit is contained in:
Rylan Polster 2021-07-05 11:29:27 -04:00
parent 36dd69dd60
commit ca5f6026ed
No known key found for this signature in database
GPG Key ID: 46A744940CFF4D64
5 changed files with 7 additions and 4 deletions

View File

@ -100,7 +100,7 @@ module Homebrew
elsif f.tap.present? elsif f.tap.present?
f.pkg_version.to_s f.pkg_version.to_s
else else
Utils::BottleAPI.latest_pkg_version(f.name).to_s Utils::BottleAPI.latest_pkg_version(f.name)&.to_s || f.pkg_version.to_s
end end
outdated_versions = outdated_kegs.group_by { |keg| Formulary.from_keg(keg).full_name } outdated_versions = outdated_kegs.group_by { |keg| Formulary.from_keg(keg).full_name }

View File

@ -88,7 +88,7 @@ module Homebrew
args.named.each do |name| args.named.each do |name|
formula = Formulary.factory(name) formula = Formulary.factory(name)
next unless formula.any_version_installed? next unless formula.any_version_installed?
next if formula.tap.present? && !formula.tap.installed? next if formula.tap.present?
next unless Utils::BottleAPI.bottle_available?(name) next unless Utils::BottleAPI.bottle_available?(name)
Utils::BottleAPI.fetch_bottles(name) Utils::BottleAPI.fetch_bottles(name)

View File

@ -161,7 +161,7 @@ module Homebrew
if ENV["HOMEBREW_JSON_CORE"].present? && !CoreTap.instance.installed? if ENV["HOMEBREW_JSON_CORE"].present? && !CoreTap.instance.installed?
formulae_to_install.map! do |formula| formulae_to_install.map! do |formula|
next formula if formula.tap.present? && formula.tap.installed? next formula if formula.tap.present?
next formula unless Utils::BottleAPI.bottle_available?(formula.name) next formula unless Utils::BottleAPI.bottle_available?(formula.name)
Utils::BottleAPI.fetch_bottles(formula.name) Utils::BottleAPI.fetch_bottles(formula.name)

View File

@ -1328,7 +1328,7 @@ class Formula
latest_version = if tap.present? latest_version = if tap.present?
pkg_version pkg_version
else else
Utils::BottleAPI.latest_pkg_version name Utils::BottleAPI.latest_pkg_version(name) || pkg_version
end end
installed_kegs.each do |keg| installed_kegs.each do |keg|

View File

@ -46,6 +46,9 @@ module Utils
output = Utils::Curl.curl_output("--fail", FORMULAE_BREW_SH_VERSIONS_API_URL) output = Utils::Curl.curl_output("--fail", FORMULAE_BREW_SH_VERSIONS_API_URL)
JSON.parse(output.stdout) JSON.parse(output.stdout)
end end
return unless @formula_versions.key? name
PkgVersion.new(@formula_versions[name]["version"], @formula_versions[name]["revision"]) PkgVersion.new(@formula_versions[name]["version"], @formula_versions[name]["revision"])
end end