feat: implement update command

This commit is contained in:
2 * r + 2 * t
2026-06-17 21:27:30 +10:00
parent a0aa37bb9b
commit 4824483bba
4 changed files with 236 additions and 1 deletions
+9
View File
@@ -73,6 +73,9 @@ class PackageInstaller(ABC):
def build_install(self, directory: Path) -> list[str]:
"""Build and install the PKGBUILD in `directory`, returning the installed package names."""
@abstractmethod
def system_update(self) -> None: ...
class NoopInstaller(PackageInstaller):
"""Used off Arch, where the dots' packages are not available via pacman/AUR."""
@@ -89,6 +92,9 @@ class NoopInstaller(PackageInstaller):
info(f"Skipping local package build (not on Arch): {directory}")
return []
def system_update(self) -> None:
info("Skipping system update (not on Arch)")
class ArchInstaller(PackageInstaller):
def __init__(self, helper: str, noconfirm: bool = False) -> None:
@@ -128,3 +134,6 @@ class ArchInstaller(PackageInstaller):
subprocess.run(["makepkg", "-fsi", *self.flags], cwd=directory, env=env, check=True)
return names
def system_update(self) -> None:
subprocess.run([self.helper, "-Syu", *self.flags], check=True)