dpkg: maze.io/x/dpkg Index | Files | Directories

package dpkg

import "maze.io/x/dpkg"

Package dpkg contains routines to parse Debian package information.

Index

Package Files

constant.go dpkg.go field.go marshal.go package.go

Constants

const (
    DependancySuggests = iota
    DependancyRecommends
    DependancyDepends
    DependancyPreDepends
    DependancyBreaks
    DependancyConflicts
    DependancyProvides
    DependancyReplaces
    DependancyEnhances
)

dpkg deptype

const (
    PriorityRequired = iota
    PriorityImportant
    PriorityStandard
    PriorityOptional
    PriorityExtra
    PriorityOther
    PriorityUnknown
    PriorityUnset = -1
)

dpkg pkgpriority

const (
    StatusNotInstalled = iota
    StatusConfigFiles
    StatusHalfInstalled
    StatusUnpacked
    StatusHalfConfigured
    StatusTriggersAwaited
    StatusTriggersPending
    StatusInstalled
)

dpkg pkgstatus

const (
    WantUnknown = iota
    WantInstall
    WantHold
    WantDeinstall
    WantPurge
)

dpkg pkgwant

const (
    Earlier       = 0001
    Later         = 0002
    Strict        = 0010
    OrEqual       = 0020
    BuiltUp       = 0100
    None          = 0200
    EarlierEqual  = BuiltUp | Earlier | OrEqual
    EarlierStrict = BuiltUp | Earlier | Strict
    LaterEqual    = BuiltUp | Later | OrEqual
    LaterStrict   = BuiltUp | Later | Strict
    Exact         = 0400
)

dpkg depverrel

Variables

var (
    DebianStatus = "/var/lib/dpkg/status"
    DebianInfo   = "/var/lib/dpkg/info"
)

func Unmarshal Uses

func Unmarshal(b []byte, d interface{}) error

Unmarshal a RFC822 style block

type Conffile Uses

type Conffile struct {
    Name string
    Hash string
}

type Conffiles Uses

type Conffiles []Conffile

func (Conffiles) Check Uses

func (f Conffiles) Check() error

func (*Conffiles) Parse Uses

func (f *Conffiles) Parse(s string) (err error)

func (Conffiles) String Uses

func (f Conffiles) String() string

type Dependancies Uses

type Dependancies []Dependancy

func (Dependancies) Check Uses

func (f Dependancies) Check() error

func (*Dependancies) Parse Uses

func (f *Dependancies) Parse(s string) (err error)

func (Dependancies) String Uses

func (f Dependancies) String() string

type Dependancy Uses

type Dependancy struct {
    PackageInfo
    Relation int
    Version  version.Version
    Type     int
}

func (Dependancy) String Uses

func (dep Dependancy) String() string

type Field Uses

type Field interface {
    Check() error
    Parse(string) error
    String() string
}

type Name Uses

type Name string

func (Name) Check Uses

func (n Name) Check() error

func (*Name) Parse Uses

func (n *Name) Parse(s string) error

func (Name) String Uses

func (n Name) String() string

type Package Uses

type Package struct {
    Name          Name `dpkg:"Package"`
    Essential     bool
    Status        Status
    Priority      Priority
    Section       string
    InstalledSize int64 `dpkg:"Installed-Size"`
    Origin        string
    Maintainer    string
    Bugs          string
    Architecture  string
    Source        string
    Version       string
    Revision      string
    ConfigVersion string `dpkg:"Config-Version"`
    Replaces      Dependancies
    Provides      Dependancies
    Depends       Dependancies
    PreDepends    Dependancies `dpkg:"Pre-Depends"`
    Recommends    Dependancies
    Suggests      Dependancies
    Breaks        Dependancies
    Conflicts     Dependancies
    Enhances      Dependancies
    Conffiles     Conffiles
    Filename      string
    Size          int64
    MD5sum        string
    Description   string
    Extra         map[string]string
}

Package describes a package in the dpkg database. Fields as described in dpkg/lib/dpkg/parse.c

func (Package) Changes Uses

func (pkg Package) Changes() (names []string, err error)

Changes lists installed files that don't pass the recorded checksum.

type PackageInfo Uses

type PackageInfo struct {
    Name     string
    Want     int
    Status   int
    Priority int
    Section  string
    Version  string
    Revision string
}

type Priority Uses

type Priority int

func (*Priority) Check Uses

func (f *Priority) Check() error

func (*Priority) Parse Uses

func (f *Priority) Parse(s string) error

func (Priority) String Uses

func (f Priority) String() string

type Status Uses

type Status struct {
    Want   string
    Flag   string
    Status string
}

func (*Status) Check Uses

func (f *Status) Check() error

func (*Status) Parse Uses

func (f *Status) Parse(s string) error

func (*Status) String Uses

func (f *Status) String() string

type StatusParser Uses

type StatusParser struct {
    // contains filtered or unexported fields
}

func NewStatus Uses

func NewStatus(r io.Reader) *StatusParser

func (*StatusParser) Packages Uses

func (p *StatusParser) Packages() (pkgs []Package, err error)

type Version Uses

type Version version.Version

func (Version) Check Uses

func (f Version) Check() error

func (*Version) Parse Uses

func (f *Version) Parse(s string) error

func (Version) String Uses

func (f Version) String() string

Directories

PathSynopsis
text
version

Package dpkg imports 14 packages (graph). Updated 2019-06-12. Refresh now. Tools for package owners.