Sourceforge: Do not modify RSS URLs

This allows a `livecheck` block to check the RSS feed for a given
path in a SourceForge project. For example:
https://sourceforge.net/projects/example/rss?path=/directory
This commit is contained in:
Sam Ford 2021-07-19 15:13:25 -04:00
parent 16b01d6e01
commit 7b864e0aaa
No known key found for this signature in database
GPG Key ID: 95209E46C7FFDEFE

View File

@ -68,7 +68,11 @@ module Homebrew
def self.find_versions(url, regex, cask: nil, &block)
match = url.match(URL_MATCH_REGEX)
page_url = "https://sourceforge.net/projects/#{match[:project_name]}/rss"
page_url = if url.match?(%r{/rss(?:/?$|\?)})
url
else
"https://sourceforge.net/projects/#{match[:project_name]}/rss"
end
# It may be possible to improve the default regex but there's quite a
# bit of variation between projects and it can be challenging to