The tests expected Install("tree") to error because dpkg/rpm need
a .deb/.rpm file path. But "tree" is pre-installed in CI containers,
so the code short-circuits to "unchanged" and returns nil.
Use a non-existent package name instead to exercise the actual
install failure path.
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>
Type assertions require an interface type, not a concrete struct pointer.
Changed all integration tests from 'mgr := pkg.New()' to
'var mgr snack.Manager = pkg.New()' so capability checks like
mgr.(snack.VersionQuerier) compile correctly.
Implements the dnf sub-package with Manager, VersionQuerier, Holder,
Cleaner, FileOwner, RepoManager, KeyManager, Grouper, and NameNormalizer
interfaces.
Implements the rpm sub-package with Manager, FileOwner, and
NameNormalizer interfaces.
Both follow the existing pattern: exported methods on struct delegate to
unexported functions, _linux.go for real implementations, _other.go with
build-tag stubs, embedded snack.Locker for mutating operations, and
compile-time interface checks.
Includes parser tests for all output formats.