aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Homebrew/cmd/audit.rb
diff options
context:
space:
mode:
authorBaptiste Fontaine2015-07-11 23:36:03 +0200
committerBaptiste Fontaine2015-07-12 20:32:15 +0200
commit3ba3ecba9dec22a0f12533792fdfb6a9910cc81b (patch)
tree423e0a7dc8da7d1cfe4d9f29414489128cd16b23 /Library/Homebrew/cmd/audit.rb
parent7d0d232fb68dd982fb2cc25d3373e4c387c9bacc (diff)
downloadbrew-3ba3ecba9dec22a0f12533792fdfb6a9910cc81b.tar.bz2
audit --online: check homepage reachability
Closes Homebrew/homebrew#41607. Signed-off-by: Baptiste Fontaine <batifon@yahoo.fr>
Diffstat (limited to 'Library/Homebrew/cmd/audit.rb')
-rw-r--r--Library/Homebrew/cmd/audit.rb7
1 files changed, 7 insertions, 0 deletions
diff --git a/Library/Homebrew/cmd/audit.rb b/Library/Homebrew/cmd/audit.rb
index cdd8eaddf..0ebe7b12a 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