recipe

package
v0.0.0-...-e7d2f50 Latest Latest
Warning

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

Go to latest
Published: Dec 6, 2020 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrMissingControl is a missing control error.
	ErrMissingControl = errors.New("missing control")
	// ErrMissingControlDescription is a missing control description error.
	ErrMissingControlDescription = errors.New("missing control description")
	// ErrMissingDescription is a missing description error.
	ErrMissingDescription = errors.New("missing description")
	// ErrMissingInstall is a missing install error.
	ErrMissingInstall = errors.New("missing install")
	// ErrMissingMaintainer is a missing maintainer error.
	ErrMissingMaintainer = errors.New("missing maintainer")
	// ErrMissingName is a missing name error.
	ErrMissingName = errors.New("missing name")
	// ErrMissingSource is a missing source error.
	ErrMissingSource = errors.New("missing source")
	// ErrMissingSourceURL is a missing source URL error.
	ErrMissingSourceURL = errors.New("missing source URL")
	// ErrUnsupportedVersion is an unsupported version error.
	ErrUnsupportedVersion = errors.New("unsupported version")
)

Functions

func VersionSupported

func VersionSupported(version int) bool

VersionSupported returns whether or not a recipe version is supported.

Types

type Control

type Control struct {
	Section  string `yaml:"section"`
	Priority string `yaml:"priority"`
	Version  struct {
		Epoch uint `yaml:"epoch"`
	} `yaml:"version"`
	Depends     []string `yaml:"depends"`
	PreDepends  []string `yaml:"pre-depends"`
	Recommends  []string `yaml:"recommends"`
	Suggests    []string `yaml:"suggests"`
	Enhances    []string `yaml:"enhances"`
	Breaks      []string `yaml:"breaks"`
	Conflicts   []string `yaml:"conflicts"`
	Description string   `yaml:"description"`
}

Control is a recipe control.

type File

type File struct {
	Path     string
	FileInfo os.FileInfo
}

File is a recipe file.

type Install

type Install struct {
	Recipe   InstallMap `yaml:"recipe"`
	Upstream InstallMap `yaml:"upstream"`
}

Install is a recipe installation.

type InstallMap

type InstallMap map[string][]InstallRule

InstallMap is a recipe installation map.

type InstallRule

type InstallRule struct {
	Pattern  string `yaml:"pattern"`
	Exclude  string `yaml:"exclude"`
	Rename   string `yaml:"rename"`
	ConfFile bool   `yaml:"conffile"`
}

InstallRule is a recipe installation rule.

type Recipe

type Recipe struct {
	Version     int               `yaml:"version"`
	Name        string            `yaml:"name"`
	Description string            `yaml:"description"`
	Maintainer  string            `yaml:"maintainer"`
	Homepage    string            `yaml:"homepage"`
	Source      *Source           `yaml:"source"`
	Control     *Control          `yaml:"control"`
	Install     *Install          `yaml:"install"`
	Dirs        []string          `yaml:"dirs"`
	Links       map[string]string `yaml:"links"`

	ControlFiles []File
	RecipeFiles  []File
}

Recipe is a packaging recipe.

func LoadRecipe

func LoadRecipe(path string) (*Recipe, error)

LoadRecipe loads a packaging recipe given a file path.

func (*Recipe) InstallPath

func (r *Recipe) InstallPath(path string, m InstallMap) (string, bool, bool)

InstallPath returns the destination installation path, whether it matches a configuration file path.

Last returned boolean will be false if the input path doesn't match the installation rules and true otherwise.

func (*Recipe) Validate

func (r *Recipe) Validate() error

Validate checks for recipe validity.

type Source

type Source struct {
	URL         string            `yaml:"url"`
	Type        string            `yaml:"type"`
	Strip       int               `yaml:"strip"`
	ArchMapping map[string]string `yaml:"arch-mapping"`
}

Source is a recipe source.

Jump to

Keyboard shortcuts

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