Add IsHeld method to Holder interface and implement in apt/dnf backends

Co-authored-by: taigrr <8261498+taigrr@users.noreply.github.com>
This commit is contained in:
copilot-swe-agent[bot]
2026-02-28 06:24:07 +00:00
parent c1ae8c4fac
commit 135e7c70f4
9 changed files with 70 additions and 0 deletions

View File

@@ -124,6 +124,11 @@ func (a *Apt) ListHeld(ctx context.Context) ([]snack.Package, error) {
return listHeld(ctx)
}
// IsHeld reports whether a specific package is currently held.
func (a *Apt) IsHeld(ctx context.Context, pkg string) (bool, error) {
return isHeld(ctx, pkg)
}
// Autoremove removes packages no longer required as dependencies.
func (a *Apt) Autoremove(ctx context.Context, opts ...snack.Option) error {
a.Lock()