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 ¶
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.
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.
type Stage ¶
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".
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".
type VersionRelation ¶
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