rpm

package
v0.0.0-...-02c76fb Latest Latest
Warning

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

Go to latest
Published: Nov 10, 2020 License: Apache-2.0 Imports: 7 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Preparer

type Preparer struct {
	// Name of the package or package group.
	Name string `hcl:"name" required:"true" nonempty:"true"`

	// State of the package. Present means the package will be installed if
	// missing; Absent means the package will be uninstalled if present.
	State pkg.State `hcl:"state" valid_values:"present,absent"`
}

Preparer for RPM Package

RPM Package manages system packages with `rpm` and `yum`. It assumes that both `rpm` and `yum` are installed on the system, and that the user has permissions to install, remove, and query packages.

func (*Preparer) Prepare

func (p *Preparer) Prepare(ctx context.Context, render resource.Renderer) (resource.Task, error)

Prepare a new packge

type YumManager

type YumManager struct {
	Sys pkg.SysCaller
}

YumManager provides a concrete implementation of PackageManager for yum packages.

func (*YumManager) InstallPackage

func (y *YumManager) InstallPackage(pkg string) (string, error)

InstallPackage installs a package, returning an error if something went wrong

func (*YumManager) InstalledVersion

func (y *YumManager) InstalledVersion(p string) (pkg.PackageVersion, bool)

InstalledVersion gets the installed version of package, if available

func (*YumManager) RemovePackage

func (y *YumManager) RemovePackage(pkg string) (string, error)

RemovePackage removes a package, returning an error if something went wrong

Jump to

Keyboard shortcuts

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