Merge pull request #14060 from SMillerDev/feature/cask/minos_audit
cask: audit for minimal OS version in sparkle feeds
This commit is contained in:
commit
29e3e5906b
@ -545,6 +545,38 @@ module Cask
|
|||||||
false
|
false
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def check_livecheck_min_os
|
||||||
|
return unless online?
|
||||||
|
return unless cask.livecheckable?
|
||||||
|
return unless cask.livecheck.strategy == :sparkle
|
||||||
|
|
||||||
|
out, _, status = curl_output(cask.livecheck.url)
|
||||||
|
return unless status.success?
|
||||||
|
|
||||||
|
require "rexml/document"
|
||||||
|
|
||||||
|
xml = begin
|
||||||
|
REXML::Document.new(out)
|
||||||
|
rescue REXML::ParseException
|
||||||
|
nil
|
||||||
|
end
|
||||||
|
|
||||||
|
return if xml.blank?
|
||||||
|
|
||||||
|
item = xml.get_elements("//rss//channel//item").first
|
||||||
|
return if item.blank?
|
||||||
|
|
||||||
|
min_os = item.elements["sparkle:minimumSystemVersion"].text
|
||||||
|
return if min_os.blank?
|
||||||
|
|
||||||
|
min_os_string = OS::Mac::Version.new(min_os).strip_patch
|
||||||
|
cask_min_os = cask.depends_on.macos.version
|
||||||
|
|
||||||
|
return if cask_min_os == min_os_string
|
||||||
|
|
||||||
|
add_error "Upstream defined #{min_os_string} as minimal OS version and the cask defined #{cask_min_os}"
|
||||||
|
end
|
||||||
|
|
||||||
sig { void }
|
sig { void }
|
||||||
def check_appcast_contains_version
|
def check_appcast_contains_version
|
||||||
return unless appcast?
|
return unless appcast?
|
||||||
|
Loading…
x
Reference in New Issue
Block a user