From 5c8ceaa4581fa848e4e69021c4826631df88ea6d Mon Sep 17 00:00:00 2001 From: Jack Nagel Date: Thu, 7 May 2015 22:14:56 -0400 Subject: [PATCH] Warn about duplicated URLs Closes Homebrew/homebrew#39486. --- Library/Homebrew/cmd/audit.rb | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/Library/Homebrew/cmd/audit.rb b/Library/Homebrew/cmd/audit.rb index 3ddbdd0488..684b2d097a 100644 --- a/Library/Homebrew/cmd/audit.rb +++ b/Library/Homebrew/cmd/audit.rb @@ -321,8 +321,15 @@ class FormulaAuditor problem "\"http://ftpmirror.gnu.org\" is preferred for GNU software (url is #{u})." end + mirrors = @specs.map(&:mirrors).flatten + dupes = urls & mirrors + + dupes.each do |dupe| + problem "URL should not be duplicated as a mirror: #{dupe}" + end + # the rest of the checks apply to mirrors as well. - urls.concat(@specs.map(&:mirrors).flatten) + urls += mirrors # Check a variety of SSL/TLS links that don't consistently auto-redirect # or are overly common errors that need to be reduced & fixed over time.