From 3d9c2facdb5c4a95fb2154d0c6857473774e4d34 Mon Sep 17 00:00:00 2001 From: Rui Chen Date: Fri, 12 Apr 2024 09:57:01 -0400 Subject: [PATCH] formula_audit: fix tag ref for pypi source Signed-off-by: Rui Chen --- Library/Homebrew/formula_auditor.rb | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/Library/Homebrew/formula_auditor.rb b/Library/Homebrew/formula_auditor.rb index 7ac8a334a0cdf1..d8d523f95e428d 100644 --- a/Library/Homebrew/formula_auditor.rb +++ b/Library/Homebrew/formula_auditor.rb @@ -243,8 +243,13 @@ def audit_license user, repo = get_repo_data(%r{https?://github\.com/([^/]+)/([^/]+)/?.*}) return if user.blank? - tag = SharedAudits.github_tag_from_url(formula.stable.url) + if formula.stable.url.include?("pythonhosted.org") + tag = formula.stable.url.match(/\/([^\/]*)\.tar\.gz$/)[1] + else + tag = SharedAudits.github_tag_from_url(formula.stable.url) + end tag ||= formula.stable.specs[:tag] + github_license = GitHub.get_repo_license(user, repo, ref: tag) return unless github_license return if (licenses + ["NOASSERTION"]).include?(github_license)