From 09dbe9f86e7bf3e8f3b7da4a61c752271c946605 Mon Sep 17 00:00:00 2001 From: Bo Anderson Date: Fri, 24 Feb 2023 18:07:19 +0000 Subject: [PATCH] readall: reject casks with no URL --- Library/Homebrew/readall.rb | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/Library/Homebrew/readall.rb b/Library/Homebrew/readall.rb index 77ecc59aa7..a8ba6ab119 100644 --- a/Library/Homebrew/readall.rb +++ b/Library/Homebrew/readall.rb @@ -67,7 +67,15 @@ module Readall success = T.let(true, T::Boolean) casks.each do |file| - Cask::CaskLoader.load(file) + cask = Cask::CaskLoader.load(file) + + # Fine to have missing URLs for unsupported macOS + macos_req = cask.depends_on.macos + next if macos_req&.version && Array(macos_req.version).none? do |macos_version| + bottle_tag.to_macos_version.public_send(macos_req.comparator, macos_version) + end + + raise "Missing URL" if cask.url.nil? rescue Interrupt raise rescue Exception => e # rubocop:disable Lint/RescueException