commands

package
v0.0.0-...-0a271de Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 27, 2025 License: AGPL-3.0 Imports: 5 Imported by: 0

Documentation

Overview

Package commands contains an interface which returns common package-manager related commands and the reference implementation for apt and yum-based systems.

Index

Constants

View Source
const (
	// AptConfFilePath is the full file path for the proxy settings that are
	// written by cloud-init and the machine environ worker.
	AptConfFilePath = "/etc/apt/apt.conf.d/95-juju-proxy-settings"
)

Variables

View Source
var (
	// ErrProxySettingNotSupported is returned when a proxy setting is not supported by snap.
	ErrProxySettingNotSupported = errors.New("proxy setting not supported by snap")
)

Functions

This section is empty.

Types

type AptPackageCommander

type AptPackageCommander struct{}

AptPackageCommander provides runnable shell commands for various apt-based packaging operations.

func NewAptPackageCommander

func NewAptPackageCommander() AptPackageCommander

NewAptPackageCommander returns an AptPackageCommander.

func (AptPackageCommander) AddRepositoryCmd

func (AptPackageCommander) AddRepositoryCmd(repo string) string

AddRepositoryCmd returns the command that adds a repository to the list of available repositories.

func (AptPackageCommander) InstallCmd

func (AptPackageCommander) InstallCmd(packages ...string) string

InstallCmd returns a *single* command that installs the given package(s).

func (AptPackageCommander) ProxyConfigContents

func (AptPackageCommander) ProxyConfigContents(settings proxy.Settings) string

ProxyConfigContents returns the format expected by the package manager for proxy settings which can be written directly to the config file.

func (AptPackageCommander) SetMirrorCommands

func (AptPackageCommander) SetMirrorCommands(newArchiveMirror, newSecurityMirror string) []string

SetMirrorCommands returns the commands to update the package archive and security mirrors.

func (AptPackageCommander) UpdateCmd

func (AptPackageCommander) UpdateCmd() string

UpdateCmd returns the command to update the local package list.

func (AptPackageCommander) UpgradeCmd

func (AptPackageCommander) UpgradeCmd() string

UpgradeCmd returns the command which issues an upgrade on all packages with available newer versions.

type SnapPackageCommander

type SnapPackageCommander struct{}

SnapPackageCommander provides runnable shell commands for snap-based package operations.

func NewSnapPackageCommander

func NewSnapPackageCommander() SnapPackageCommander

NewSnapPackageCommander returns a PackageCommander for snap-based systems.

func (SnapPackageCommander) InstallCmd

func (SnapPackageCommander) InstallCmd(packs ...string) string

InstallCmd returns a *single* command that installs the given package(s).

func (SnapPackageCommander) SetProxyCmds

func (SnapPackageCommander) SetProxyCmds(settings proxy.Settings) ([]string, error)

SetProxyCmds returns the commands which configure snap's proxy configuration

func (SnapPackageCommander) UpgradeCmd

func (SnapPackageCommander) UpgradeCmd() string

UpdateCmd returns the command to update the local package list.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL