Commit Graph

9 Commits

Author SHA1 Message Date
c55027f9b7 merge: resolve pacman capabilities conflict (keep both interfaces) 2026-02-28 07:07:21 +00:00
b0e39036de Merge remote-tracking branch 'origin/copilot/add-install-remove-changes-reporting' into cd/integration-copilot-prs 2026-02-28 07:07:00 +00:00
copilot-swe-agent[bot]
22dda8684d Move GroupIsInstalled to separate GroupQuerier optional interface
Co-authored-by: taigrr <8261498+taigrr@users.noreply.github.com>
2026-02-28 06:54:28 +00:00
copilot-swe-agent[bot]
34578efcad Update all package managers to return InstallResult/RemoveResult
Change Install and Remove method signatures across all package manager
implementations (apt, apk, dnf, pacman, rpm, dpkg, snap, flatpak, ports,
pkg) to match the updated Manager interface.

- Wrapper files: update Install/Remove to return (snack.InstallResult, error)
  and (snack.RemoveResult, error) respectively
- Platform files (_linux.go, _openbsd.go, _freebsd.go): implement pre-check
  logic using isInstalled() to classify packages as unchanged or to-process,
  run command on actionable packages only, then collect results with version()
- Stub files (_other.go): return (snack.InstallResult{}, ErrUnsupportedPlatform)
  and (snack.RemoveResult{}, ErrUnsupportedPlatform)
- DNF special case: add v5 bool parameter to internal install/remove functions
  and thread d.v5 from the wrapper; update Purge to discard the result
- cmd/snack/main.go: update install/remove commands to discard InstallResult/
  RemoveResult and return only the error to cobra

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-02-28 06:31:01 +00:00
copilot-swe-agent[bot]
dec1516387 Add GroupIsInstalled to Grouper interface with pacman and dnf implementations
Co-authored-by: taigrr <8261498+taigrr@users.noreply.github.com>
2026-02-28 06:23:21 +00:00
copilot-swe-agent[bot]
9f943e9097 Add DryRunner interface and DryRun capability for dry-run support detection
Co-authored-by: taigrr <8261498+taigrr@users.noreply.github.com>
2026-02-28 06:22:26 +00:00
ef81e027ce feat: add capability interfaces for extended package manager operations
Add optional interfaces that providers can implement beyond the base
Manager. grlx can type-assert to check support at runtime:

- VersionQuerier: LatestVersion, ListUpgrades, UpgradeAvailable, VersionCmp
- Holder: Hold, Unhold, ListHeld (version pinning)
- Cleaner: Autoremove, Clean (orphan/cache cleanup)
- FileOwner: FileList, Owner (file-to-package mapping)
- RepoManager: ListRepos, AddRepo, RemoveRepo
- KeyManager: AddKey, RemoveKey, ListKeys (GPG signing keys)
- Grouper: GroupList, GroupInfo, GroupInstall
- NameNormalizer: NormalizeName, ParseArch

Also adds GetCapabilities() helper, Repository type, and updated README.
2026-02-25 20:42:04 +00:00
6cbfc96e3d feat: add Target type for per-package version/repo/source constraints
Breaking change to Manager interface: Install/Remove/Purge now accept
[]Target instead of []string. Target supports Version pinning, FromRepo
constraints, and Source paths — matching SaltStack's pkgs list semantics.

Also adds WithRefresh, WithFromRepo, WithReinstall options.
2026-02-25 20:32:25 +00:00
08514a27e1 feat: initial project scaffold
- Common Manager interface, Package type, functional options
- Sentinel errors for common package manager failures
- Sub-package stubs for: pacman, aur, apk, apt, dpkg, dnf, rpm,
  flatpak, snap, pkg (FreeBSD), ports (OpenBSD)
- detect/ package for auto-detection of system package manager
- 0BSD license
2026-02-25 20:01:51 +00:00