From 3ba3ecba9dec22a0f12533792fdfb6a9910cc81b Mon Sep 17 00:00:00 2001 From: Baptiste Fontaine Date: Sat, 11 Jul 2015 23:36:03 +0200 Subject: [PATCH] audit --online: check homepage reachability Closes Homebrew/homebrew#41607. Signed-off-by: Baptiste Fontaine --- Library/Homebrew/cmd/audit.rb | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/Library/Homebrew/cmd/audit.rb b/Library/Homebrew/cmd/audit.rb index cdd8eaddfa..0ebe7b12ac 100644 --- a/Library/Homebrew/cmd/audit.rb +++ b/Library/Homebrew/cmd/audit.rb @@ -428,6 +428,13 @@ class FormulaAuditor %r[^http://code\.google\.com/] problem "Please use https:// for #{homepage}" end + + return unless @online + begin + nostdout { curl "--connect-timeout", "15", "-IL", "-o", "/dev/null", homepage } + rescue ErrorDuringExecution + problem "The homepage is not reachable (curl exit code #{$?.exitstatus})" + end end def audit_github_repository