feat(platform): add Reinstall helpers to Pacman and Yay
This commit is contained in:
@@ -76,6 +76,17 @@ func (p Pacman) Install(ctx context.Context, pkgs []string) error {
|
||||
return p.Runner.Run(ctx, "sudo", args...)
|
||||
}
|
||||
|
||||
// Reinstall runs `sudo pacman -S --noconfirm <pkgs...>` WITHOUT `--needed`,
|
||||
// so pacman physically re-fetches and reinstalls the packages even if they
|
||||
// are already present. Used by the `--force` flag to bypass idempotency.
|
||||
func (p Pacman) Reinstall(ctx context.Context, pkgs []string) error {
|
||||
if len(pkgs) == 0 {
|
||||
return nil
|
||||
}
|
||||
args := append([]string{"pacman", "-S", "--noconfirm"}, pkgs...)
|
||||
return p.Runner.Run(ctx, "sudo", args...)
|
||||
}
|
||||
|
||||
// Update runs `sudo pacman -Syu --noconfirm` (full sync + system upgrade).
|
||||
// On Arch, a bare `pacman -Sy` followed by an install is the partial-upgrade
|
||||
// anti-pattern that can break the system when a dep's ABI changes, so we
|
||||
|
||||
Reference in New Issue
Block a user