Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnton Hvornum <anton.feeds+github@gmail.com>2020-03-16 15:06:36 +0100
committerAnton Hvornum <anton.feeds+github@gmail.com>2020-03-16 15:06:36 +0100
commit3393c94f08b73b03f4e7d94e2b01939a87bf0a54 (patch)
treec6742c91bcf147d0b4479881e78f8321173048dd
parentb5a970223093a201d9271dea49fa1cb35131b17f (diff)
New function: add_custom_mirror(). Adds a custom mirror to /etc/pacman.conf with SigLevel set to Optional and TrustAll by default.
-rw-r--r--archinstall.py11
1 files changed, 11 insertions, 0 deletions
diff --git a/archinstall.py b/archinstall.py
index 2fcaac55..552458b2 100644
--- a/archinstall.py
+++ b/archinstall.py
@@ -979,6 +979,17 @@ def filter_mirrors_by_country_list(countries, top=None, *positionals, **kwargs):
return True
+def add_custom_mirror(name, url, *positionals, **kwargs):
+ if not SAFETY_LOCK:
+ commandlog.append('# Adding custom mirror to /etc/pacman.conf')
+ with open('/etc/pacman.conf', 'a') as mirrorlist:
+ commandlog.append(f'# {name} @ {url}')
+ mirrorlist.write('\n')
+ mirrorlist.write(f'[{name}]\n')
+ mirrorlist.write(f'Server = {url}\n')
+ mirrorlist.write(f'SigLevel = Optional TrustAll\n')
+ return True
+
def add_specific_mirrors(mirrors, *positionals, **kwargs):
if not SAFETY_LOCK:
commandlog.append('# Adding mirrors to /etc/pacman.d/mirrorlist')