Documentation
¶
Overview ¶
Package aur provides a native Go client for the Arch User Repository.
Unlike other snack backends that wrap CLI tools, aur uses the AUR RPC API directly for queries and git+makepkg for building. Packages are built in a temporary directory and installed via pacman -U.
Requirements: git, makepkg, pacman (all present on any Arch Linux system).
Index ¶
- type AUR
- func (a *AUR) Autoremove(ctx context.Context, opts ...snack.Option) error
- func (a *AUR) Available() bool
- func (a *AUR) Clean(_ context.Context) error
- func (a *AUR) Info(ctx context.Context, pkg string) (*snack.Package, error)
- func (a *AUR) Install(ctx context.Context, pkgs []snack.Target, opts ...snack.Option) (snack.InstallResult, error)
- func (a *AUR) IsInstalled(ctx context.Context, pkg string) (bool, error)
- func (a *AUR) LatestVersion(ctx context.Context, pkg string) (string, error)
- func (a *AUR) List(ctx context.Context) ([]snack.Package, error)
- func (a *AUR) ListUpgrades(ctx context.Context) ([]snack.Package, error)
- func (a *AUR) Name() string
- func (a *AUR) Purge(ctx context.Context, pkgs []snack.Target, opts ...snack.Option) error
- func (a *AUR) Remove(ctx context.Context, pkgs []snack.Target, opts ...snack.Option) (snack.RemoveResult, error)
- func (a *AUR) Search(ctx context.Context, query string) ([]snack.Package, error)
- func (a *AUR) Update(_ context.Context) error
- func (a *AUR) Upgrade(ctx context.Context, opts ...snack.Option) error
- func (a *AUR) UpgradeAvailable(ctx context.Context, pkg string) (bool, error)
- func (a *AUR) UpgradePackages(ctx context.Context, pkgs []snack.Target, opts ...snack.Option) (snack.InstallResult, error)
- func (a *AUR) Version(ctx context.Context, pkg string) (string, error)
- func (a *AUR) VersionCmp(ctx context.Context, ver1, ver2 string) (int, error)
- type AUROption
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AUR ¶
type AUR struct {
snack.Locker
// BuildDir is the base directory for cloning and building packages.
// If empty, a temporary directory is created per build.
BuildDir string
// MakepkgFlags are extra flags passed to makepkg (e.g. "--skippgpcheck").
MakepkgFlags []string
}
AUR wraps the Arch User Repository using its RPC API and makepkg.
func NewWithOptions ¶
NewWithOptions returns a new AUR manager with the given options.
func (*AUR) Autoremove ¶
Autoremove removes orphaned packages via pacman.
func (*AUR) Available ¶
Available reports whether the AUR toolchain (git, makepkg, pacman) is present.
func (*AUR) Install ¶
func (a *AUR) Install(ctx context.Context, pkgs []snack.Target, opts ...snack.Option) (snack.InstallResult, error)
Install clones, builds, and installs AUR packages.
func (*AUR) IsInstalled ¶
IsInstalled reports whether a package is currently installed.
func (*AUR) LatestVersion ¶
LatestVersion returns the latest version available in the AUR.
func (*AUR) List ¶
List returns all installed foreign (non-repo) packages, which are typically AUR packages.
func (*AUR) ListUpgrades ¶
ListUpgrades returns installed foreign packages that have newer versions in the AUR.
func (*AUR) Remove ¶
func (a *AUR) Remove(ctx context.Context, pkgs []snack.Target, opts ...snack.Option) (snack.RemoveResult, error)
Remove removes packages via pacman (AUR packages are regular pacman packages once installed).
func (*AUR) UpgradeAvailable ¶
UpgradeAvailable reports whether a newer version is available in the AUR.
func (*AUR) UpgradePackages ¶
func (a *AUR) UpgradePackages(ctx context.Context, pkgs []snack.Target, opts ...snack.Option) (snack.InstallResult, error)
UpgradePackages rebuilds and reinstalls specific AUR packages.
type AUROption ¶
type AUROption func(*AUR)
Option configures an AUR manager.
func WithBuildDir ¶
WithBuildDir sets a persistent build directory.
func WithMakepkgFlags ¶
WithMakepkgFlags sets extra flags for makepkg.