1 |
commit: eb9a6203b721d7247f79cb8c991ef835f1b9e1f7 |
2 |
Author: Brian Dolbec <dolsen <AT> gentoo <DOT> org> |
3 |
AuthorDate: Mon May 30 23:01:21 2022 +0000 |
4 |
Commit: Brian Dolbec <dolsen <AT> gentoo <DOT> org> |
5 |
CommitDate: Mon May 30 23:11:33 2022 +0000 |
6 |
URL: https://gitweb.gentoo.org/proj/mirrorselect.git/commit/?id=eb9a6203 |
7 |
|
8 |
Apply bug 730994 https filtering patch |
9 |
|
10 |
Author: Peter Levine |
11 |
Signed-off-by: Brian Dolbec <dolsen <AT> gentoo.org> |
12 |
|
13 |
mirrorselect.8 | 3 +++ |
14 |
mirrorselect/extractor.py | 2 +- |
15 |
mirrorselect/main.py | 7 +++++-- |
16 |
3 files changed, 9 insertions(+), 3 deletions(-) |
17 |
|
18 |
diff --git a/mirrorselect.8 b/mirrorselect.8 |
19 |
index 8f0f56e..49caadd 100644 |
20 |
--- a/mirrorselect.8 |
21 |
+++ b/mirrorselect.8 |
22 |
@@ -44,6 +44,9 @@ ftp only mode. Will not consider hosts of other types. |
23 |
.B \-H, \-\-http |
24 |
http only mode. Will not consider hosts of other types. |
25 |
.TP |
26 |
+.B \-S, \-\-https |
27 |
+https only mode. Will not consider hosts of other types. |
28 |
+.TP |
29 |
.B \-r, \-\-rsync |
30 |
rsync mode. Allows you to interactively select your rsync mirror. |
31 |
Requires -i to be used. |
32 |
|
33 |
diff --git a/mirrorselect/extractor.py b/mirrorselect/extractor.py |
34 |
index dca8302..19dc059 100644 |
35 |
--- a/mirrorselect/extractor.py |
36 |
+++ b/mirrorselect/extractor.py |
37 |
@@ -50,7 +50,7 @@ class Extractor(object): |
38 |
filters[opt] = value |
39 |
self.output.print_info('Limiting test to "%s=%s" hosts. \n' |
40 |
%(opt, value)) |
41 |
- for opt in ["ftp", "http"]: |
42 |
+ for opt in ["ftp", "http", "https"]: |
43 |
if getattr(options, opt): |
44 |
filters["proto"] = opt |
45 |
self.output.print_info('Limiting test to %s hosts. \n' % opt ) |
46 |
|
47 |
diff --git a/mirrorselect/main.py b/mirrorselect/main.py |
48 |
index c3b5633..b0a68cc 100755 |
49 |
--- a/mirrorselect/main.py |
50 |
+++ b/mirrorselect/main.py |
51 |
@@ -181,6 +181,9 @@ class MirrorSelect(object): |
52 |
group.add_option( |
53 |
"-H", "--http", action="store_true", default=False, |
54 |
help="http only mode. Will not consider hosts of other types") |
55 |
+ group.add_option( |
56 |
+ "-S", "--https", action="store_true", default=False, |
57 |
+ help="https only mode. Will not consider hosts of other types") |
58 |
group.add_option( |
59 |
"-r", "--rsync", action="store_true", default=False, |
60 |
help="rsync mode. Allows you to interactively select your" |
61 |
@@ -255,8 +258,8 @@ class MirrorSelect(object): |
62 |
# sanity checks |
63 |
|
64 |
# hack: check if more than one of these is set |
65 |
- if options.http + options.ftp + options.rsync > 1: |
66 |
- self.output.print_err('Choose at most one of -H, -f and -r') |
67 |
+ if options.http + options.https + options.ftp + options.rsync > 1: |
68 |
+ self.output.print_err('Choose at most one of -H, -S, -f and -r') |
69 |
|
70 |
if options.ipv4 and options.ipv6: |
71 |
self.output.print_err('Choose at most one of --ipv4 and --ipv6') |