r5@ryzen ~ $ mirrorselect --version; mirrorselect --all Mirrorselect version: 2.3.0-r1 ERROR: Choose at most one of -s or -a Reproducible: Always Steps to Reproduce: 1. mirrorselect --all Actual Results: ERROR: Choose at most one of -s or -a Expected Results: A list of mirrors. As a workaround, one may use the nonsensical incarnation mirrorselect --all --servers 0 A patch that can be used to fix the issue is ryzen ~ # cat /etc/portage/patches/app-portage/mirrorselect-2.3.0-r1/dash-all.patch diff --git a/mirrorselect/main.py b/mirrorselect/main.py index 0fbd7b2..444582a 100755 --- a/mirrorselect/main.py +++ b/mirrorselect/main.py @@ -145,6 +145,11 @@ class MirrorSelect(object): self.output.white(" interactive:"), " # mirrorselect -i -r", )) + + def set_servers(option, opt_str, value, parser): + set_servers.user_configured = True + setattr(parser.values, option.dest, value) + parser = OptionParser( formatter=ColoredFormatter(self.output), description=desc, version='Mirrorselect version: %s' % version) @@ -236,8 +241,8 @@ class MirrorSelect(object): "-q", "--quiet", action="store_const", const=0, dest="verbosity", help="Quiet mode") group.add_option( - "-s", "--servers", action="store", type="int", default=1, - help="Specify Number of servers for Automatic Mode " + "-s", "--servers", action="callback", callback=set_servers, + type="int", default=1, help="Specify Number of servers for Automatic Mode " "to select. this is only valid for download mirrors. " "If this is not specified, a default of 1 is used.") group.add_option( @@ -271,7 +276,7 @@ class MirrorSelect(object): if options.rsync and not (options.interactive or options.all_mirrors): self.output.print_err('rsync servers can only be selected with -i or -a') - if options.servers and options.all_mirrors: + if options.all_mirrors and hasattr(set_servers, 'user_configured'): self.output.print_err('Choose at most one of -s or -a') if options.interactive and (
Created attachment 813340 [details, diff] Potential Fix
can reproduce failure locally
Note 2.3.0-r1 is now marked stable, not (~)
The bug has been referenced in the following commit(s): https://gitweb.gentoo.org/proj/mirrorselect.git/commit/?id=e0fbc2fb33762211aa5e64175d525e66f4c257d4 commit e0fbc2fb33762211aa5e64175d525e66f4c257d4 Author: Sam James <sam@gentoo.org> AuthorDate: 2023-07-06 08:04:42 +0000 Commit: Sam James <sam@gentoo.org> CommitDate: 2023-07-06 08:04:42 +0000 main: Fix --all option parsing Avoid --all erroring out with "ERROR: Choose at most one of -s or -a". Bug: https://bugs.gentoo.org/872218 Fixes: 7caac017833b01e13028658effc502430c56d770 Thanks-to: <xpenev@gmail.com> Signed-off-by: Sam James <sam@gentoo.org> mirrorselect/main.py | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-)
The bug has been referenced in the following commit(s): https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=6a0735a283ec84214d5226749bf590fe45e5cb28 commit 6a0735a283ec84214d5226749bf590fe45e5cb28 Author: Sam James <sam@gentoo.org> AuthorDate: 2023-07-06 08:08:45 +0000 Commit: Sam James <sam@gentoo.org> CommitDate: 2023-07-06 08:08:45 +0000 app-portage/mirrorselect: backport --all parsing fix Bug: https://bugs.gentoo.org/872218 Signed-off-by: Sam James <sam@gentoo.org> ...rselect-2.3.0-main-Fix-all-option-parsing.patch | 48 ++++++++++++++++++++++ .../mirrorselect/mirrorselect-2.3.0-r2.ebuild | 44 ++++++++++++++++++++ 2 files changed, 92 insertions(+)