Merge pull request #5159 from vszakats/debmirrcanon
audit: use debian canonical mirror
This commit is contained in:
commit
0ac0eaf484
@ -43,6 +43,7 @@ module RuboCop
|
|||||||
%r{^http://code\.google\.com/},
|
%r{^http://code\.google\.com/},
|
||||||
%r{^http://fossies\.org/},
|
%r{^http://fossies\.org/},
|
||||||
%r{^http://mirrors\.kernel\.org/},
|
%r{^http://mirrors\.kernel\.org/},
|
||||||
|
%r{^http://mirrors\.ocf\.berkeley\.edu/},
|
||||||
%r{^http://(?:[^/]*\.)?bintray\.com/},
|
%r{^http://(?:[^/]*\.)?bintray\.com/},
|
||||||
%r{^http://tools\.ietf\.org/},
|
%r{^http://tools\.ietf\.org/},
|
||||||
%r{^http://launchpad\.net/},
|
%r{^http://launchpad\.net/},
|
||||||
@ -125,10 +126,19 @@ module RuboCop
|
|||||||
problem <<~EOS
|
problem <<~EOS
|
||||||
Please use a secure mirror for Debian URLs.
|
Please use a secure mirror for Debian URLs.
|
||||||
We recommend:
|
We recommend:
|
||||||
https://mirrors.ocf.berkeley.edu/debian/#{match[1]}
|
https://deb.debian.org/debian/#{match[1]}
|
||||||
EOS
|
EOS
|
||||||
end
|
end
|
||||||
|
|
||||||
|
# Check to use canonical urls for Debian packages
|
||||||
|
noncanon_deb_pattern =
|
||||||
|
Regexp.union([%r{^https://mirrors\.kernel\.org/debian/},
|
||||||
|
%r{^https://mirrors\.ocf\.berkeley\.edu/debian/},
|
||||||
|
%r{^https://(?:[^/]*\.)?mirrorservice\.org/sites/ftp\.debian\.org/debian/}])
|
||||||
|
audit_urls(urls, noncanon_deb_pattern) do |_, url|
|
||||||
|
problem "Please use https://deb.debian.org/debian/ for #{url}"
|
||||||
|
end
|
||||||
|
|
||||||
# Check for new-url Google Code download urls, https:// is preferred
|
# Check for new-url Google Code download urls, https:// is preferred
|
||||||
google_code_pattern = Regexp.union([%r{^http://.*\.googlecode\.com/files.*},
|
google_code_pattern = Regexp.union([%r{^http://.*\.googlecode\.com/files.*},
|
||||||
%r{^http://code\.google\.com/}])
|
%r{^http://code\.google\.com/}])
|
||||||
|
|||||||
@ -76,9 +76,33 @@ describe RuboCop::Cop::FormulaAudit::Urls do
|
|||||||
"msg" => <<~EOS,
|
"msg" => <<~EOS,
|
||||||
Please use a secure mirror for Debian URLs.
|
Please use a secure mirror for Debian URLs.
|
||||||
We recommend:
|
We recommend:
|
||||||
https://mirrors.ocf.berkeley.edu/debian/dists/foo/
|
https://deb.debian.org/debian/dists/foo/
|
||||||
EOS
|
EOS
|
||||||
"col" => 2,
|
"col" => 2,
|
||||||
|
}, {
|
||||||
|
"url" => "https://mirrors.kernel.org/debian/pool/main/n/nc6/foo.tar.gz",
|
||||||
|
"msg" => "Please use " \
|
||||||
|
"https://deb.debian.org/debian/ for " \
|
||||||
|
"https://mirrors.kernel.org/debian/pool/main/n/nc6/foo.tar.gz",
|
||||||
|
"col" => 2,
|
||||||
|
}, {
|
||||||
|
"url" => "https://mirrors.ocf.berkeley.edu/debian/pool/main/m/mkcue/foo.tar.gz",
|
||||||
|
"msg" => "Please use " \
|
||||||
|
"https://deb.debian.org/debian/ for " \
|
||||||
|
"https://mirrors.ocf.berkeley.edu/debian/pool/main/m/mkcue/foo.tar.gz",
|
||||||
|
"col" => 2,
|
||||||
|
}, {
|
||||||
|
"url" => "https://mirrorservice.org/sites/ftp.debian.org/debian/pool/main/n/netris/foo.tar.gz",
|
||||||
|
"msg" => "Please use " \
|
||||||
|
"https://deb.debian.org/debian/ for " \
|
||||||
|
"https://mirrorservice.org/sites/ftp.debian.org/debian/pool/main/n/netris/foo.tar.gz",
|
||||||
|
"col" => 2,
|
||||||
|
}, {
|
||||||
|
"url" => "https://www.mirrorservice.org/sites/ftp.debian.org/debian/pool/main/n/netris/foo.tar.gz",
|
||||||
|
"msg" => "Please use " \
|
||||||
|
"https://deb.debian.org/debian/ for " \
|
||||||
|
"https://www.mirrorservice.org/sites/ftp.debian.org/debian/pool/main/n/netris/foo.tar.gz",
|
||||||
|
"col" => 2,
|
||||||
}, {
|
}, {
|
||||||
"url" => "http://foo.googlecode.com/files/foo-1.0.zip",
|
"url" => "http://foo.googlecode.com/files/foo-1.0.zip",
|
||||||
"msg" => "Please use https:// for http://foo.googlecode.com/files/foo-1.0.zip",
|
"msg" => "Please use https:// for http://foo.googlecode.com/files/foo-1.0.zip",
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user