From 2fcbff8ee250993d0090c0b1071fbd48d0ad988e Mon Sep 17 00:00:00 2001 From: Aaron Ruan Date: Sun, 26 May 2024 16:51:44 +0800 Subject: [PATCH] disable osdn.jp URL --- Library/Homebrew/cask/audit.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Library/Homebrew/cask/audit.rb b/Library/Homebrew/cask/audit.rb index ffa47e7394..b8088013f3 100644 --- a/Library/Homebrew/cask/audit.rb +++ b/Library/Homebrew/cask/audit.rb @@ -328,7 +328,7 @@ module Cask add_error "SourceForge URL format incorrect. See #{Formatter.url(SOURCEFORGE_OSDN_REFERENCE_URL)}", location: cask.url.location elsif bad_osdn_url? - add_error "OSDN URL format incorrect. See #{Formatter.url(SOURCEFORGE_OSDN_REFERENCE_URL)}", + add_error "OSDN URLs are disabled.", location: cask.url.location end end @@ -895,7 +895,7 @@ module Cask sig { returns(T::Boolean) } def bad_osdn_url? - bad_url_format?(/osd/, [%r{\Ahttps?://([^/]+.)?dl\.osdn\.jp/}]) + cask.url.to_s.match?(/^(?:https?:\/\/)?(?:\w+\.)*osdn\.jp(?=\/|$)/) end # sig { returns(String) }