public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
From: "Brian Dolbec" <dolsen@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] proj/mirrorselect:master commit in: /, mirrorselect/
Date: Sat, 26 May 2018 15:43:23 +0000 (UTC)	[thread overview]
Message-ID: <1527349231.d0f37a2cb9734439c2d69f74c16ffb0489a30280.dolsen@gentoo> (raw)

commit:     d0f37a2cb9734439c2d69f74c16ffb0489a30280
Author:     i.Dark_Templar <darktemplar <AT> dark-templar-archives <DOT> net>
AuthorDate: Sat May 26 15:28:53 2018 +0000
Commit:     Brian Dolbec <dolsen <AT> gentoo <DOT> org>
CommitDate: Sat May 26 15:40:31 2018 +0000
URL:        https://gitweb.gentoo.org/proj/mirrorselect.git/commit/?id=d0f37a2c

Mirrorselect: add 'exclude' option to allow excluding hosts from mirrors list.

 mirrorselect.8       | 3 +++
 mirrorselect/main.py | 7 +++++++
 2 files changed, 10 insertions(+)

diff --git a/mirrorselect.8 b/mirrorselect.8
index cd7b8bb..3a1e304 100644
--- a/mirrorselect.8
+++ b/mirrorselect.8
@@ -96,6 +96,9 @@ download mirrors. If this is not specified, a default of 1 is used.
 .TP
 .BI \-t " TIMEOUT " "\fR,\fP \-timeout" " TIMEOUT "
 Timeout for deep mode. Defaults to 10 seconds.
+.TP
+.BI \-e " EXCLUDE " "\fR,\fP \-exclude" " EXCLUDE "
+Exclude host from mirrors list.
 
 .SH "EXAMPLES"
 automatic:

diff --git a/mirrorselect/main.py b/mirrorselect/main.py
index 04698f3..b49461b 100755
--- a/mirrorselect/main.py
+++ b/mirrorselect/main.py
@@ -243,6 +243,9 @@ class MirrorSelect(object):
 		group.add_option(
 			"-t", "--timeout", action="store", type="int",
 			default="10", help="Timeout for deep mode. Defaults to 10 seconds.")
+		group.add_option(
+			"-e", "--exclude", action="append", dest="exclude",
+			default=None, help="Exclude host from mirrors list.")
 
 
 
@@ -302,6 +305,10 @@ class MirrorSelect(object):
 		else:
 			self.output.write("using url: %s\n" % MIRRORS_3_XML, 2)
 			hosts = Extractor(MIRRORS_3_XML, options, self.output).hosts
+
+		if options.exclude:
+			hosts = [x for x in hosts if x[0] not in options.exclude]
+
 		return hosts
 
 


             reply	other threads:[~2018-05-26 15:43 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-05-26 15:43 Brian Dolbec [this message]
  -- strict thread matches above, loose matches on Subject: below --
2022-05-30 23:12 [gentoo-commits] proj/mirrorselect:master commit in: /, mirrorselect/ Brian Dolbec
2019-07-17  5:09 Zac Medico
2019-05-27 18:08 Zac Medico
2014-01-31 15:44 [gentoo-commits] proj/mirrorselect:ssl " Brian Dolbec
2014-03-02  7:44 ` [gentoo-commits] proj/mirrorselect:master " Brian Dolbec

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=1527349231.d0f37a2cb9734439c2d69f74c16ffb0489a30280.dolsen@gentoo \
    --to=dolsen@gentoo.org \
    --cc=gentoo-commits@lists.gentoo.org \
    --cc=gentoo-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