aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Homebrew
diff options
context:
space:
mode:
authorDominyk Tiller2016-05-30 20:29:33 +0100
committerDominyk Tiller2016-05-31 13:32:47 +0100
commit331fdba29d9364ba20e99e1fa8db074ac482ca9c (patch)
tree36a4fa24f7b74172b46b5ae3c63134918eeae453 /Library/Homebrew
parent92e35705f8e1012cb5bcecc6e75d7d11d14fa667 (diff)
downloadbrew-331fdba29d9364ba20e99e1fa8db074ac482ca9c.tar.bz2
audit: prefer https/s over ftp where known available
The FTP protocol is prone to getting firewalled to death in places, so where we know we can avoid that by using either secure or more commonly accepted protocols let's do so. Examples of output: ``` * Stable: ftp://ftp.cpan.org/pub/CPAN/authors/id/N/NE/NEILB/Time-Duration-1.20.tar.gz should be `http://search.cpan.org/CPAN/authors/id/N/NE/NEILB/Time-Duration-1.20.tar.gz` * Stable: Please use https:// for ftp://ftp.mirrorservice.org/sites/lsof.itap.purdue.edu/pub/tools/unix/lsof/lsof_4.89.tar.bz2 ```
Diffstat (limited to 'Library/Homebrew')
-rw-r--r--Library/Homebrew/cmd/audit.rb10
1 files changed, 10 insertions, 0 deletions
diff --git a/Library/Homebrew/cmd/audit.rb b/Library/Homebrew/cmd/audit.rb
index 5005782f8..614b76464 100644
--- a/Library/Homebrew/cmd/audit.rb
+++ b/Library/Homebrew/cmd/audit.rb
@@ -1175,6 +1175,16 @@ class ResourceAuditor
end
end
+ # Prefer HTTP/S when possible over FTP protocol due to possible firewalls.
+ urls.each do |p|
+ case p
+ when %r{^ftp://ftp\.mirrorservice\.org}
+ problem "Please use https:// for #{p}"
+ when %r{^ftp://ftp\.cpan\.org/pub/CPAN(.*)}i
+ problem "#{p} should be `http://search.cpan.org/CPAN#{$1}`"
+ end
+ end
+
# Check SourceForge urls
urls.each do |p|
# Skip if the URL looks like a SVN repo