feat: add per-provider mutex and Target-aware implementations

- Add snack.Locker embed for per-provider mutex serialization
- Update all providers (pacman, apk, apt, dpkg) to use []Target
  with version pinning support (pkg=version syntax)
- Add lock/unlock to all mutating operations (Install, Remove, Purge,
  Upgrade, Update)
- Add snack.TargetNames helper and formatTargets per provider
- apt: add FromRepo (-t) and Reinstall support
- dpkg: use Target.Source for .deb file paths in Install
This commit is contained in:
2026-02-25 20:35:45 +00:00
parent 6cbfc96e3d
commit 0d6c5d9e17
14 changed files with 198 additions and 52 deletions

View File

@@ -10,15 +10,15 @@ import (
func available() bool { return false }
func install(_ context.Context, _ []string, _ ...snack.Option) error {
func install(_ context.Context, _ []snack.Target, _ ...snack.Option) error {
return snack.ErrUnsupportedPlatform
}
func remove(_ context.Context, _ []string, _ ...snack.Option) error {
func remove(_ context.Context, _ []snack.Target, _ ...snack.Option) error {
return snack.ErrUnsupportedPlatform
}
func purge(_ context.Context, _ []string, _ ...snack.Option) error {
func purge(_ context.Context, _ []snack.Target, _ ...snack.Option) error {
return snack.ErrUnsupportedPlatform
}