args: remove -m and -mp (MR 2371)

Remove arguments to set postmarketOS and Alpine mirrors.

The current implementation is broken with the way the mirrors are now
configured: The current implementation fills a list, but the mirror
configuration code expects a string. It is not longer possible to set
an arbitrary amount of mirrors for the postmarketOS mirror. The benefit
is that we don't have comma separated values in the config file anymore
but instead just simple strings. Now it is possible to have one proper
mirror for aports, pmaports and pmaports_systemd, and one _custom one
to override each of these.

We already have too many options in "pmbootstrap -h", and changing a
mirror is more of a base configuration that you do once and maybe change
a few times, but don't need to be able to set it with each pmbootstrap
run. Users are not going to write this out manually on their
command-lines, it only makes sense in scripts and wrappers for
pmbootstrap, and there you could as well use another method (as now
described in docs/mirrors.md) to set the mirrors.

Less important, but another reason is that using "-mp" (two letters as
short argument) isn't really elegant.
This commit is contained in:
Oliver Smith 2024-07-10 23:50:02 +02:00 committed by Caleb Connolly
parent 1fe7b9931c
commit ebfda16d6d
No known key found for this signature in database
GPG key ID: 0583312B195F64B6
3 changed files with 22 additions and 24 deletions

View file

@ -75,14 +75,6 @@ def init(args: PmbArgs) -> PmbArgs:
if hasattr(args, key):
delattr(args, key)
# Handle --mirror-alpine and --mirror-pmos
value = getattr(args, "mirror_alpine", None)
if value:
config.mirrors["alpine"] = value
value = getattr(args, "mirror_postmarketos", None)
if value:
config.mirrors["pmaports"] = value
# Configure runtime context
context = Context(config)
context.command_timeout = args.timeout