1 |
--- |
2 |
repoman/pym/repoman/modules/scan/ebuild/checks.py | 17 +++++++++++++++++ |
3 |
repoman/pym/repoman/modules/scan/ebuild/errors.py | 2 ++ |
4 |
repoman/pym/repoman/qa_data.py | 4 +++- |
5 |
3 files changed, 22 insertions(+), 1 deletion(-) |
6 |
|
7 |
diff --git a/repoman/pym/repoman/modules/scan/ebuild/checks.py b/repoman/pym/repoman/modules/scan/ebuild/checks.py |
8 |
index 15e225156db4..1a21096dd4d1 100644 |
9 |
--- a/repoman/pym/repoman/modules/scan/ebuild/checks.py |
10 |
+++ b/repoman/pym/repoman/modules/scan/ebuild/checks.py |
11 |
@@ -682,6 +682,23 @@ class EMakeParallelDisabledViaMAKEOPTS(LineCheck): |
12 |
error = errors.EMAKE_PARALLEL_DISABLED_VIA_MAKEOPTS |
13 |
|
14 |
|
15 |
+class UriUseHttps(LineCheck): |
16 |
+ """Check that we use https:// for known good sites.""" |
17 |
+ repoman_check_name = 'uri.https' |
18 |
+ _SITES = ( |
19 |
+ '[-._a-zA-Z0-9]*apache\.org', |
20 |
+ 'curl\.haxx\.se', |
21 |
+ '((dev|www)\.)?gentoo\.org', |
22 |
+ 'github\.com', |
23 |
+ 'savannah\.(non)?gnu\.org', |
24 |
+ '((gcc|www)\.)?gnu\.org', |
25 |
+ '(sf|sourceforge)\.net', |
26 |
+ '(www\.)?sourceware\.org', |
27 |
+ ) |
28 |
+ re = re.compile(r'.*\bhttp://(%s)' % r'|'.join(_SITES)) |
29 |
+ error = errors.URI_HTTPS |
30 |
+ |
31 |
+ |
32 |
class NoAsNeeded(LineCheck): |
33 |
"""Check for calls to the no-as-needed function.""" |
34 |
repoman_check_name = 'upstream.workaround' |
35 |
diff --git a/repoman/pym/repoman/modules/scan/ebuild/errors.py b/repoman/pym/repoman/modules/scan/ebuild/errors.py |
36 |
index 3090de0d1a2c..14e47e35877e 100644 |
37 |
--- a/repoman/pym/repoman/modules/scan/ebuild/errors.py |
38 |
+++ b/repoman/pym/repoman/modules/scan/ebuild/errors.py |
39 |
@@ -47,3 +47,5 @@ USEQ_ERROR = ( |
40 |
'Ebuild calls deprecated useq function on line: %d') |
41 |
HASQ_ERROR = ( |
42 |
'Ebuild calls deprecated hasq function on line: %d') |
43 |
+URI_HTTPS = ( |
44 |
+ 'Ebuild uses http:// but should use https:// on line: %d') |
45 |
diff --git a/repoman/pym/repoman/qa_data.py b/repoman/pym/repoman/qa_data.py |
46 |
index b9475e801368..055fc4b72c59 100644 |
47 |
--- a/repoman/pym/repoman/qa_data.py |
48 |
+++ b/repoman/pym/repoman/qa_data.py |
49 |
@@ -222,7 +222,8 @@ qahelp = { |
50 |
"The ebuild makes use of an obsolete construct"), |
51 |
"upstream.workaround": ( |
52 |
"The ebuild works around an upstream bug," |
53 |
- " an upstream bug should be filed and tracked in bugs.gentoo.org") |
54 |
+ " an upstream bug should be filed and tracked in bugs.gentoo.org"), |
55 |
+ "uri.https": "URI uses http:// but should use https://", |
56 |
} |
57 |
|
58 |
qacats = list(qahelp) |
59 |
@@ -271,6 +272,7 @@ qawarnings = set(( |
60 |
"LIVEVCS.stable", |
61 |
"LIVEVCS.unmasked", |
62 |
"IUSE.rubydeprecated", |
63 |
+ "uri.https", |
64 |
)) |
65 |
|
66 |
|
67 |
-- |
68 |
2.8.2 |