config

package
v0.0.0-...-56cb166 Latest Latest
Warning

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

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

Documentation

Overview

Package config defines an interface which returns packaging-related configuration options and operations depending on the desired package-management system.

Index

Constants

View Source
const (
	// LegacyAptSourcesFile is the default file which list all core
	// sources for apt packages on an apt-based system for ubuntu
	// distros before noble
	LegacyAptSourcesFile = "/etc/apt/sources.list"

	// LegacyAptSourcesFile is the default file which list all core
	// sources for apt packages on an apt-based system for ubuntu
	// distros noble or after
	AptSourcesFile = "/etc/apt/sources.list.d/ubuntu.sources"

	// AptListsDirectory is the location of the APT sources list.
	AptListsDirectory = "/var/lib/apt/lists"

	// AptConfigDirectory is the default directory in which
	// apt configuration files are stored.
	AptConfigDirectory = "/etc/apt/apt.conf.d"

	// AptSourceListPrefix is a shell program that translates an
	// APT source (piped from stdin) to a file prefix. The algorithm
	// involves stripping up to one trailing slash, stripping the
	// URL scheme prefix, and finally translating slashes to
	// underscores.
	AptSourceListPrefix = `sed 's,.*://,,' | sed 's,/$,,' | tr / _`
)
View Source
const (
	// PackageManagerLoopFunction is a bash function that executes its arguments
	// in a loop with a delay until either the command either returns
	// with an exit code other than 100. It times out after 5 failed attempts.
	PackageManagerLoopFunction = `` /* 357-byte string literal not displayed */

)

Variables

View Source
var (
	// AptProxyConfigFile is the full file path for the proxy settings that are
	// written by cloudinit and the machine environ worker.
	AptProxyConfigFile = AptConfigDirectory + "/95-juju-proxy-settings"

	// AptPreferenceTemplate is the template specific to an apt preference file.
	AptPreferenceTemplate = template.Must(template.New("").Parse(`
Explanation: {{.Explanation}}
Package: {{.Package}}
Pin: {{.Pin}}
Pin-Priority: {{.Priority}}
`[1:]))
)

Functions

This section is empty.

Types

type AptConfigurer

type AptConfigurer struct{}

AptConfigurer is the PackagingConfigurer implementation for apt-based systems.

func NewAptPackagingConfigurer

func NewAptPackagingConfigurer() AptConfigurer

NewAptPackagingConfigurer returns a PackagingConfigurer for apt-based systems.

func (AptConfigurer) RenderPreferences

func (c AptConfigurer) RenderPreferences(prefs source.PackagePreferences) (string, error)

RenderPreferences is defined on the PackagingConfigurer interface.

Jump to

Keyboard shortcuts

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