pmbootstrap init: Add mirror choice (MR 2035)

Allows user to choose one of the mirrors from
https://mirrors.postmarketos.org.

Example:
[1] Mirror 1 (Location 1)
[2] Mirror 2 (Location 2)
[3] Mirror 3 (Location 3)
Select a mirror [1]: 2

Co-Authored-By: Alexey Min <alexey.min@gmail.com>
This commit is contained in:
Anri Dellal 2021-03-17 20:09:59 +03:00 committed by Oliver Smith
parent c5bd07e3ae
commit 5c1da79634
No known key found for this signature in database
GPG key ID: 5AE7F5513E0885CB
4 changed files with 82 additions and 5 deletions

View file

@ -79,7 +79,9 @@ def fix_mirrors_postmarketos(args):
subparsers: <https://bugs.python.org/issue9338> """
# -mp not specified: use default mirrors
if not args.mirrors_postmarketos:
args.mirrors_postmarketos = pmb.config.defaults["mirrors_postmarketos"]
cfg = pmb.config.load(args)
args.mirrors_postmarketos = \
cfg["pmbootstrap"]["mirrors_postmarketos"].split(",")
# -mp="": use no postmarketOS mirrors (build everything locally)
if args.mirrors_postmarketos == [""]: