From 6f83e20f4974d83b08bc7eab64a556477f2f4d20 Mon Sep 17 00:00:00 2001 From: Jack Nagel Date: Wed, 30 Nov 2011 13:14:24 -0600 Subject: [PATCH] audit: only perform GNU URL check on primary URLs Signed-off-by: Jack Nagel --- Library/Homebrew/cmd/audit.rb | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/Library/Homebrew/cmd/audit.rb b/Library/Homebrew/cmd/audit.rb index 31c0fbaeba..d3ea129a48 100755 --- a/Library/Homebrew/cmd/audit.rb +++ b/Library/Homebrew/cmd/audit.rb @@ -198,6 +198,14 @@ def audit_formula_urls f urls = [(f.url rescue nil), (f.head rescue nil)].reject {|p| p.nil?} urls.uniq! # head-only formulae result in duplicate entries + # Check GNU urls; doesn't apply to mirrors + urls.each do |p| + if p =~ %r[^(https?|ftp)://(.+)/gnu/] + problems << " * \"ftpmirror.gnu.org\" is preferred for GNU software." + end + end + + # the rest of the checks apply to mirrors as well f.mirrors.each do |m| mirror = m.values_at :url urls << (mirror.to_s rescue nil) @@ -236,14 +244,6 @@ def audit_formula_urls f end end - # Check GNU urls - # FIXME only check primary URLs, not mirrors - # urls.each do |p| - # if p =~ %r[^(https?|ftp)://(.+)/gnu/] - # problems << " * \"ftpmirror.gnu.org\" is preferred for GNU software." - # end - # end - return problems end