From 323af39ed57191747604b64d1c6ed6a46719c84f Mon Sep 17 00:00:00 2001 From: Anton Hvornum Date: Tue, 1 Sep 2020 14:04:47 +0200 Subject: Added archinstall.Installer().set_mirrors, which allows to modify the mirrors in the finished installed medium. --- archinstall/lib/installer.py | 4 ++++ archinstall/lib/mirrors.py | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) (limited to 'archinstall/lib') diff --git a/archinstall/lib/installer.py b/archinstall/lib/installer.py index 3ab0adc2..e69f25bf 100644 --- a/archinstall/lib/installer.py +++ b/archinstall/lib/installer.py @@ -5,6 +5,7 @@ from .disk import * from .general import * from .user_interaction import * from .profiles import Profile +from .mirrors import * class Installer(): """ @@ -82,6 +83,9 @@ class Installer(): else: log(f'Could not sync mirrors: {sync_mirrors.exit_code}') + def set_mirrors(self, mirrors): + return use_mirrors(mirrors, destination=f'{self.mountpoint}/etc/pacman.d/mirrorlist') + def genfstab(self, flags='-Pu'): o = b''.join(sys_command(f'/usr/bin/genfstab -pU {self.mountpoint} >> {self.mountpoint}/etc/fstab')) if not os.path.isfile(f'{self.mountpoint}/etc/fstab'): diff --git a/archinstall/lib/mirrors.py b/archinstall/lib/mirrors.py index fc2048ca..a4aade9c 100644 --- a/archinstall/lib/mirrors.py +++ b/archinstall/lib/mirrors.py @@ -57,7 +57,7 @@ def insert_mirrors(mirrors, *args, **kwargs): return True def use_mirrors(regions :dict, destination='/etc/pacman.d/mirrorlist'): - log(f'Updating mirror list: {destination}') + log(f'A new package mirror-list has been created: {destination}') for region, mirrors in regions.items(): with open(destination, 'w') as mirrorlist: for mirror in mirrors: -- cgit v1.2.3-70-g09d2