commit:     abf62a8889702c6fa42a30807636e119d7aa312b
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Thu Oct  6 08:32:13 2016 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Thu Oct  6 20:07:38 2016 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=abf62a88

repoman: Disable SRC_URI.mirror warnings when there is only 1 mirror

Disable SRC_URI.mirror warnings when the thirdpartymirrors entry
consists of no more than 1 mirror. In this case, the mirror:// is really
no different than direct URL, and it most likely means the entry is only
kept for backwards compatibility.

Closes: https://github.com/gentoo/portage/pull/58

 repoman/pym/repoman/modules/scan/fetch/fetches.py | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/repoman/pym/repoman/modules/scan/fetch/fetches.py 
b/repoman/pym/repoman/modules/scan/fetch/fetches.py
index 555f34f..9ee3c65 100644
--- a/repoman/pym/repoman/modules/scan/fetch/fetches.py
+++ b/repoman/pym/repoman/modules/scan/fetch/fetches.py
@@ -36,6 +36,12 @@ class FetchChecks(ScanBase):
                self.thirdpartymirrors = {}
                profile_thirdpartymirrors = 
self.repo_settings.repoman_settings.thirdpartymirrors().items()
                for mirror_alias, mirrors in profile_thirdpartymirrors:
+                       # Skip thirdpartymirrors that do not list more than one 
mirror
+                       # anymore. There is no point in using mirror:// there 
and this
+                       # means that the thirdpartymirrors entry will most 
likely
+                       # be removed anyway.
+                       if len(mirrors) <= 1:
+                               continue
                        for mirror in mirrors:
                                if not mirror.endswith("/"):
                                        mirror += "/"

Reply via email to