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

@ -261,13 +261,16 @@ def test_questions_additional_options(args, monkeypatch):
assert cfg == {"pmbootstrap": {}}
# Answer everything
fake_answers(monkeypatch, ["y", "128", "64", "5", "2G", "n", "n"])
fake_answers(monkeypatch, ["y", "128", "64", "5", "2G", "n", "y", "1",
"n"])
func(args, cfg)
mirror = pmb.config.defaults["mirrors_postmarketos"]
assert cfg == {"pmbootstrap": {"extra_space": "128",
"boot_size": "64",
"jobs": "5",
"ccache_size": "2G",
"sudo_timer": "False"}}
"sudo_timer": "False",
"mirrors_postmarketos": mirror}}
def test_questions_hostname(args, monkeypatch):