Skip to content

Commit

Permalink
formula_audit: fix tag ref for pypi source
Browse files Browse the repository at this point in the history
Signed-off-by: Rui Chen <[email protected]>
  • Loading branch information
chenrui333 committed Apr 12, 2024
1 parent 4f85192 commit 3d9c2fa
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion Library/Homebrew/formula_auditor.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 3d9c2fa

Please sign in to comment.