From: Zbigniew Jędrzejewski-Szmek Date: Tue, 25 May 2021 14:56:23 +0000 (+0200) Subject: mkosi: make run_pacman() function top-level X-Git-Tag: v10~25^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F724%2Fhead;p=thirdparty%2Fmkosi.git mkosi: make run_pacman() function top-level No need to have this function dynamic. --- diff --git a/mkosi/__init__.py b/mkosi/__init__.py index 45139cbde..9bae9d406 100644 --- a/mkosi/__init__.py +++ b/mkosi/__init__.py @@ -2689,6 +2689,16 @@ def install_ubuntu(args: CommandLineArguments, root: str, do_run_build_script: b install_debian_or_ubuntu(args, root, do_run_build_script=do_run_build_script) +def run_pacman(root: str, pacman_conf: str, packages: Set[str]) -> None: + try: + run(["pacman-key", "--config", pacman_conf, "--init"]) + run(["pacman-key", "--config", pacman_conf, "--populate"]) + run(["pacman", "--config", pacman_conf, "--noconfirm", "-Sy", *sort_packages(packages)]) + finally: + # Kill the gpg-agent started by pacman and pacman-key. + run(["gpgconf", "--homedir", os.path.join(root, "etc/pacman.d/gnupg"), "--kill", "all"]) + + @complete_step("Installing Arch Linux") def install_arch(args: CommandLineArguments, root: str, do_run_build_script: bool) -> None: if args.release is not None: @@ -2996,19 +3006,8 @@ def install_arch(args: CommandLineArguments, root: str, do_run_build_script: boo if not do_run_build_script and args.ssh: add_packages(args, packages, "openssh") - def run_pacman(packages: Set[str]) -> None: - conf = ["--config", pacman_conf] - - try: - run(["pacman-key", *conf, "--init"]) - run(["pacman-key", *conf, "--populate"]) - run(["pacman", *conf, "--noconfirm", "-Sy", *sort_packages(packages)]) - finally: - # Kill the gpg-agent started by pacman and pacman-key. - run(["gpgconf", "--homedir", os.path.join(root, "etc/pacman.d/gnupg"), "--kill", "all"]) - with mount_api_vfs(args, root): - run_pacman(packages) + run_pacman(root, pacman_conf, packages) # If /etc/locale.gen exists, uncomment the desired locale and leave the rest of the file untouched. # If it doesn’t exist, just write the desired locale in it.