From e0f999388d17702d05595cb12971c4d8ec0a54c4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Luis=20Guzm=C3=A1n?= Date: Mon, 17 Mar 2025 22:42:00 +0000 Subject: [PATCH] python-apt: update mirror parser and add note --- .../DATA/python-apt/parse-mirror-masterlist.py | 18 +++++++++++++++++- helpers/make-python-apt | 1 + 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/helpers/DATA/python-apt/parse-mirror-masterlist.py b/helpers/DATA/python-apt/parse-mirror-masterlist.py index 5066811..6867e53 100644 --- a/helpers/DATA/python-apt/parse-mirror-masterlist.py +++ b/helpers/DATA/python-apt/parse-mirror-masterlist.py @@ -31,6 +31,10 @@ parser.add_argument( "-c", help="Filter by country (e.g., AU, BR, CA)", default=None) +parser.add_argument( + "--mirmon", + action="store_true", + help="List mirrors suitable for mirmon output") args = parser.parse_args() with open(args.file, 'r') as file: @@ -67,13 +71,25 @@ for block in blocks: mirrors[country] = {} mirrors[country][site] = {"https": https_urls, "http": http_urls} +# Print mirmon output if selected +if args.mirmon: + for country, sites in sorted(mirrors.items()): + if args.country and country != args.country: + continue + for site, urls in sites.items(): + if urls["https"]: + print(f"{country.lower()} {urls['https'][0]}") + elif urls["http"]: + print(f"{country.lower()} {urls['http'][0]}") + exit(0) + # Print output for country, sites in sorted(mirrors.items()): if args.country and country != args.country: continue valid_sites = { - site: urls for site, urls in sites.items() + site: urls for site, urls in sites.items() if urls["https"] or urls["http"] } if not valid_sites: diff --git a/helpers/make-python-apt b/helpers/make-python-apt index 2917873..22a4fae 100644 --- a/helpers/make-python-apt +++ b/helpers/make-python-apt @@ -22,6 +22,7 @@ # 'choose-mirror' package as a dependency for debian-installer, so when # a new release of the 'debian-installer' also ships the latest mirror # list available on the resulting netinstall (mini.iso) image. +# The same way as 'ubiquity' is for for the next Live Desktop ISOs. VERSION=10 COMPONENT=main