public inbox for gentoo-portage-dev@lists.gentoo.org
 help / color / mirror / Atom feed
From: Mike Frysinger <vapier@gentoo.org>
To: gentoo-portage-dev@lists.gentoo.org
Subject: [gentoo-portage-dev] [PATCH] repoman: flag URIs using http:// when https:// is available
Date: Mon, 13 Jun 2016 00:22:04 -0400	[thread overview]
Message-ID: <1465791724-17361-1-git-send-email-vapier@gentoo.org> (raw)

---
 repoman/pym/repoman/modules/scan/ebuild/checks.py | 17 +++++++++++++++++
 repoman/pym/repoman/modules/scan/ebuild/errors.py |  2 ++
 repoman/pym/repoman/qa_data.py                    |  4 +++-
 3 files changed, 22 insertions(+), 1 deletion(-)

diff --git a/repoman/pym/repoman/modules/scan/ebuild/checks.py b/repoman/pym/repoman/modules/scan/ebuild/checks.py
index 15e225156db4..1a21096dd4d1 100644
--- a/repoman/pym/repoman/modules/scan/ebuild/checks.py
+++ b/repoman/pym/repoman/modules/scan/ebuild/checks.py
@@ -682,6 +682,23 @@ class EMakeParallelDisabledViaMAKEOPTS(LineCheck):
 	error = errors.EMAKE_PARALLEL_DISABLED_VIA_MAKEOPTS
 
 
+class UriUseHttps(LineCheck):
+	"""Check that we use https:// for known good sites."""
+	repoman_check_name = 'uri.https'
+	_SITES = (
+		'[-._a-zA-Z0-9]*apache\.org',
+		'curl\.haxx\.se',
+		'((dev|www)\.)?gentoo\.org',
+		'github\.com',
+		'savannah\.(non)?gnu\.org',
+		'((gcc|www)\.)?gnu\.org',
+		'(sf|sourceforge)\.net',
+		'(www\.)?sourceware\.org',
+	)
+	re = re.compile(r'.*\bhttp://(%s)' % r'|'.join(_SITES))
+	error = errors.URI_HTTPS
+
+
 class NoAsNeeded(LineCheck):
 	"""Check for calls to the no-as-needed function."""
 	repoman_check_name = 'upstream.workaround'
diff --git a/repoman/pym/repoman/modules/scan/ebuild/errors.py b/repoman/pym/repoman/modules/scan/ebuild/errors.py
index 3090de0d1a2c..14e47e35877e 100644
--- a/repoman/pym/repoman/modules/scan/ebuild/errors.py
+++ b/repoman/pym/repoman/modules/scan/ebuild/errors.py
@@ -47,3 +47,5 @@ USEQ_ERROR = (
 	'Ebuild calls deprecated useq function on line: %d')
 HASQ_ERROR = (
 	'Ebuild calls deprecated hasq function on line: %d')
+URI_HTTPS = (
+	'Ebuild uses http:// but should use https:// on line: %d')
diff --git a/repoman/pym/repoman/qa_data.py b/repoman/pym/repoman/qa_data.py
index b9475e801368..055fc4b72c59 100644
--- a/repoman/pym/repoman/qa_data.py
+++ b/repoman/pym/repoman/qa_data.py
@@ -222,7 +222,8 @@ qahelp = {
 		"The ebuild makes use of an obsolete construct"),
 	"upstream.workaround": (
 		"The ebuild works around an upstream bug,"
-		" an upstream bug should be filed and tracked in bugs.gentoo.org")
+		" an upstream bug should be filed and tracked in bugs.gentoo.org"),
+	"uri.https": "URI uses http:// but should use https://",
 }
 
 qacats = list(qahelp)
@@ -271,6 +272,7 @@ qawarnings = set((
 	"LIVEVCS.stable",
 	"LIVEVCS.unmasked",
 	"IUSE.rubydeprecated",
+	"uri.https",
 ))
 
 
-- 
2.8.2



             reply	other threads:[~2016-06-13  4:22 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-06-13  4:22 Mike Frysinger [this message]
2016-06-13  8:17 ` [gentoo-portage-dev] [PATCH] repoman: flag URIs using http:// when https:// is available Alexander Berntsen
2016-06-27 21:13 ` [gentoo-portage-dev] [PATCH v2] " Mike Frysinger

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1465791724-17361-1-git-send-email-vapier@gentoo.org \
    --to=vapier@gentoo.org \
    --cc=gentoo-portage-dev@lists.gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox