mirror of
https://github.com/gogrlx/snack.git
synced 2026-04-02 05:08:42 -07:00
- Add brew package for Homebrew support on macOS and Linux - Implement NameNormalizer interface (NormalizeName, ParseArch) for all providers - Add darwin platform detection with Homebrew as default - Consolidate capabilities by removing separate *_linux.go/*_other.go files - Update tests for new capability expectations - Add comprehensive tests for AUR and brew providers - Update README with capability matrix and modern Target API usage 💘 Generated with Crush Assisted-by: AWS Claude Opus 4.5 via Crush <crush@charm.land>
47 lines
1.3 KiB
Go
47 lines
1.3 KiB
Go
package aur
|
|
|
|
import (
|
|
"context"
|
|
|
|
"github.com/gogrlx/snack"
|
|
)
|
|
|
|
// LatestVersion returns the latest version of an AUR package.
|
|
func (a *AUR) LatestVersion(ctx context.Context, pkg string) (string, error) {
|
|
return latestVersion(ctx, pkg)
|
|
}
|
|
|
|
// ListUpgrades returns AUR packages that have newer versions available.
|
|
func (a *AUR) ListUpgrades(ctx context.Context) ([]snack.Package, error) {
|
|
return listUpgrades(ctx)
|
|
}
|
|
|
|
// UpgradeAvailable reports whether a newer version is available.
|
|
func (a *AUR) UpgradeAvailable(ctx context.Context, pkg string) (bool, error) {
|
|
return upgradeAvailable(ctx, pkg)
|
|
}
|
|
|
|
// VersionCmp compares two version strings using vercmp.
|
|
func (a *AUR) VersionCmp(ctx context.Context, ver1, ver2 string) (int, error) {
|
|
return versionCmp(ctx, ver1, ver2)
|
|
}
|
|
|
|
// Autoremove removes orphaned packages via pacman.
|
|
func (a *AUR) Autoremove(ctx context.Context, opts ...snack.Option) error {
|
|
a.Lock()
|
|
defer a.Unlock()
|
|
return autoremove(ctx, opts...)
|
|
}
|
|
|
|
// Clean is a no-op for AUR (builds use temp directories).
|
|
func (a *AUR) Clean(_ context.Context) error {
|
|
return nil
|
|
}
|
|
|
|
// UpgradePackages rebuilds and reinstalls specific AUR packages.
|
|
func (a *AUR) UpgradePackages(ctx context.Context, pkgs []snack.Target, opts ...snack.Option) (snack.InstallResult, error) {
|
|
a.Lock()
|
|
defer a.Unlock()
|
|
return upgradePackages(ctx, pkgs, opts...)
|
|
}
|