Documentation ¶
Overview ¶
The Dependency module 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 ¶
- Variables
- type Arch
- type ArchSet
- type Dependency
- func (dep *Dependency) GetAllPossibilities() []Possibility
- func (dep *Dependency) GetPossibilities(arch Arch) []Possibility
- func (dep *Dependency) GetSubstvars() []Possibility
- func (dep Dependency) MarshalControl() (string, error)
- func (dependency Dependency) String() string
- func (dep *Dependency) UnmarshalControl(data string) error
- type Possibility
- type Relation
- type Stage
- type StageSet
- type VersionRelation
Constants ¶
This section is empty.
Variables ¶
var ( Any = Arch{ABI: "any", OS: "any", CPU: "any"} All = Arch{ABI: "all", OS: "all", CPU: "all"} )
Functions ¶
This section is empty.
Types ¶
type Arch ¶
func ParseArchitectures ¶
func (*Arch) IsWildcard ¶
func (Arch) MarshalControl ¶
func (*Arch) UnmarshalControl ¶
type ArchSet ¶
Arch 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 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) GetAllPossibilities ¶
func (dep *Dependency) GetAllPossibilities() []Possibility
func (*Dependency) GetPossibilities ¶
func (dep *Dependency) GetPossibilities(arch Arch) []Possibility
func (*Dependency) GetSubstvars ¶
func (dep *Dependency) GetSubstvars() []Possibility
func (Dependency) MarshalControl ¶
func (dep Dependency) MarshalControl() (string, error)
func (Dependency) String ¶
func (dependency Dependency) String() string
func (*Dependency) UnmarshalControl ¶
func (dep *Dependency) UnmarshalControl(data string) error
type Possibility ¶
type Possibility struct { Name string 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 (possi 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 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) SatisfiedBy ¶
func (v VersionRelation) SatisfiedBy(ver version.Version) bool
func (VersionRelation) String ¶
func (version VersionRelation) String() string