dependency

package
v0.5.1 Latest Latest
Warning

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

Go to latest
Published: Jul 18, 2024 License: MPL-2.0 Imports: 8 Imported by: 0

Documentation

Overview

Package dependency provides an interface to parse and inspect Debian * Dependency relationships. * * Dependency | foo, bar (>= 1.0) [amd64] | baz * -> Relations | -> Relation bar (>= 1.0) [amd64] | baz * -> Possibilities | -> Possibility bar (>= 1.0) [amd64] * | Name | -> Name bar * | Version | -> Version (>= 1.0) * | Architectures | -> Arch amd64 * | Stages |

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ArchSet

type ArchSet struct {
	Not           bool
	Architectures []arch.Arch
}

ArchSet models an architecture dependency restriction, commonly used to restrict the relation to one some architectures. This is also usually used in a string of many possibilities.

func (ArchSet) String

func (set ArchSet) String() string

type Dependency

type Dependency struct {
	Relations []Relation
}

A Dependency is the top level type that models a full Dependency relation.

func MustParse

func MustParse(in string) Dependency

MustParse is a helper function to wrap Parse and panic on error.

func Parse

func Parse(in string) (Dependency, error)

Parse a string into a Dependency object. The input should look something like "foo, bar | baz".

func (Dependency) MarshalText

func (dep Dependency) MarshalText() ([]byte, error)

func (Dependency) String

func (dep Dependency) String() string

func (*Dependency) UnmarshalText

func (dep *Dependency) UnmarshalText(text []byte) error

type Possibility

type Possibility struct {
	Name          string
	Arch          *arch.Arch
	Architectures *ArchSet
	StageSets     []StageSet
	Version       *VersionRelation
	Substvar      bool
}

Possibility models a concrete Possibility that may be satisfied in order to satisfy the Dependency Relation. Given the Dependency line:

Depends: foo, bar | baz

All of foo, bar and baz are Possibilities. Possibilities may come with further restrictions, such as restrictions on Version, Architecture, or Build Stage.

func (Possibility) String

func (pos Possibility) String() string

type Relation

type Relation struct {
	Possibilities []Possibility
}

A Relation is a set of Possibilities that must be satisfied. Given the Dependency line:

Depends: foo, bar | baz

There are two Relations, one composed of foo, and another composed of bar and baz.

func (Relation) String

func (rel Relation) String() string

type Stage

type Stage struct {
	Not  bool
	Name string
}

Stage models a build stage that a Possibility may be restricted to. For example, a Possibility may only be satisfied during the build stage "build".

func (Stage) String

func (stage Stage) String() string

type StageSet

type StageSet struct {
	Stages []Stage
}

StageSet models a set of build stages that a Possibility may be restricted to. For example, a Possibility may only be satisfied during the build stages "build" and "host".

func (StageSet) String

func (set StageSet) String() string

type VersionRelation

type VersionRelation struct {
	Version  version.Version
	Operator string
}

VersionRelation models a version restriction on a possibility, such as greater than version 1.0, or less than 2.0. The values that are valid in the Operator field are defined by section 7.1 of Debian policy.

The relations allowed are <<, <=, =, >= and >> for strictly earlier,
earlier or equal, exactly equal, later or equal and strictly later,
respectively.

func (VersionRelation) String

func (ver VersionRelation) String() string

Jump to

Keyboard shortcuts

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