From: Daan De Meyer Date: Wed, 27 May 2020 17:59:02 +0000 (+0200) Subject: Arch: Move run_pacman and run_pacstrap definitions to their call sites X-Git-Tag: v6~82^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F421%2Fhead;p=thirdparty%2Fmkosi.git Arch: Move run_pacman and run_pacstrap definitions to their call sites --- diff --git a/mkosi b/mkosi index 25cfcb7ce..3d7befedc 100755 --- a/mkosi +++ b/mkosi @@ -2087,15 +2087,6 @@ SigLevel = Optional TrustedOnly Server = {repository_server} """) - def run_pacman(args: List[str], **kwargs: Any) -> subprocess.CompletedProcess: - cmdline = [ - "pacman", - "--noconfirm", - "--color", "never", - "--config", pacman_conf, - ] - return run(cmdline + args, **kwargs, check=True) - def run_pacman_key(args: List[str]) -> subprocess.CompletedProcess: cmdline = [ "pacman-key", @@ -2104,10 +2095,6 @@ Server = {repository_server} ] return run(cmdline + args, check=True) - def run_pacstrap(packages: Set[str]) -> None: - cmdline = ["pacstrap", "-C", pacman_conf, "-GM", root] - run(cmdline + list(packages), check=True) - keyring = "archlinux" if platform.machine() == "aarch64": keyring += "arm" @@ -2146,6 +2133,10 @@ Server = {repository_server} packages.add("mkinitcpio") + def run_pacstrap(packages: Set[str]) -> None: + cmdline = ["pacstrap", "-C", pacman_conf, "-GM", root] + run(cmdline + list(packages), check=True) + # Set up system with packages from the base group run_pacstrap(packages) @@ -2183,6 +2174,16 @@ default_image="/boot/initramfs-{kernel}.img" if do_run_build_script: packages.update(args.build_packages) + + def run_pacman(args: List[str], **kwargs: Any) -> subprocess.CompletedProcess: + cmdline = [ + "pacman", + "--noconfirm", + "--color", "never", + "--config", pacman_conf, + ] + return run(cmdline + args, **kwargs, check=True) + # Remove already installed packages c = run_pacman(['-Qq'], stdout=PIPE, universal_newlines=True) packages.difference_update(c.stdout.split())