mirror of
https://github.com/gogrlx/snack.git
synced 2026-04-02 05:08:42 -07:00
Implement the snack.Manager interface for both apt (Debian/Ubuntu) and dpkg (low-level Debian package tool). apt wraps apt-get, apt-cache, and dpkg-query for full package management. dpkg wraps dpkg and dpkg-query for low-level .deb operations. Upgrade and Update return ErrUnsupportedPlatform for dpkg. Both packages include: - Linux implementations with proper error wrapping - Non-linux build stubs returning ErrUnsupportedPlatform - Output parsing helpers with tests - Functional options support (sudo, assume-yes, dry-run)
44 lines
990 B
Go
44 lines
990 B
Go
//go:build !linux
|
|
|
|
package dpkg
|
|
|
|
import (
|
|
"context"
|
|
|
|
"github.com/gogrlx/snack"
|
|
)
|
|
|
|
func available() bool { return false }
|
|
|
|
func install(_ context.Context, _ []string, _ ...snack.Option) error {
|
|
return snack.ErrUnsupportedPlatform
|
|
}
|
|
|
|
func remove(_ context.Context, _ []string, _ ...snack.Option) error {
|
|
return snack.ErrUnsupportedPlatform
|
|
}
|
|
|
|
func purge(_ context.Context, _ []string, _ ...snack.Option) error {
|
|
return snack.ErrUnsupportedPlatform
|
|
}
|
|
|
|
func list(_ context.Context) ([]snack.Package, error) {
|
|
return nil, snack.ErrUnsupportedPlatform
|
|
}
|
|
|
|
func search(_ context.Context, _ string) ([]snack.Package, error) {
|
|
return nil, snack.ErrUnsupportedPlatform
|
|
}
|
|
|
|
func info(_ context.Context, _ string) (*snack.Package, error) {
|
|
return nil, snack.ErrUnsupportedPlatform
|
|
}
|
|
|
|
func isInstalled(_ context.Context, _ string) (bool, error) {
|
|
return false, snack.ErrUnsupportedPlatform
|
|
}
|
|
|
|
func version(_ context.Context, _ string) (string, error) {
|
|
return "", snack.ErrUnsupportedPlatform
|
|
}
|