fix: use tempdir for aur helper install

This commit is contained in:
2 * r + 2 * t
2026-06-14 21:23:10 +10:00
parent 44df61b22d
commit 8627b7b96f
+1 -6
View File
@@ -17,7 +17,7 @@ def _install_aur_helper(helper: str, noconfirm: bool = False) -> None:
subprocess.run(pacman_cmd, check=True) subprocess.run(pacman_cmd, check=True)
repo_url = f"https://aur.archlinux.org/{helper}.git" repo_url = f"https://aur.archlinux.org/{helper}.git"
repo_dir = f"/tmp/{helper}" with tempfile.TemporaryDirectory() as repo_dir:
subprocess.run(["git", "clone", repo_url, repo_dir], check=True) subprocess.run(["git", "clone", repo_url, repo_dir], check=True)
makepkg_cmd = ["makepkg", "-si"] makepkg_cmd = ["makepkg", "-si"]
@@ -25,11 +25,6 @@ def _install_aur_helper(helper: str, noconfirm: bool = False) -> None:
makepkg_cmd.append("--noconfirm") makepkg_cmd.append("--noconfirm")
subprocess.run(makepkg_cmd, cwd=repo_dir, check=True) subprocess.run(makepkg_cmd, cwd=repo_dir, check=True)
try:
shutil.rmtree(repo_dir)
except FileNotFoundError:
pass
if helper == "yay": if helper == "yay":
subprocess.run(["yay", "-Y", "--gendb"], check=True) subprocess.run(["yay", "-Y", "--gendb"], check=True)
subprocess.run(["yay", "-Y", "--devel", "--save"], check=True) subprocess.run(["yay", "-Y", "--devel", "--save"], check=True)