dpkg

package module
v0.0.0-...-1b0ebdf Latest Latest
Warning

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

Go to latest
Published: Sep 13, 2016 License: MIT Imports: 14 Imported by: 0

README

go-dpkg

Build Status

Documentation

Overview

Package dpkg contains routines to parse Debian package information.

Index

Constants

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

dpkg deptype

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

dpkg pkgpriority

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

dpkg pkgstatus

View Source
const (
	WantUnknown = iota
	WantInstall
	WantHold
	WantDeinstall
	WantPurge
)

dpkg pkgwant

View Source
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

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

Functions

func Unmarshal

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

Unmarshal a RFC822 style block

Types

type Conffile

type Conffile struct {
	Name string
	Hash string
}

type Conffiles

type Conffiles []Conffile

func (Conffiles) Check

func (f Conffiles) Check() error

func (*Conffiles) Parse

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

func (Conffiles) String

func (f Conffiles) String() string

type Dependancies

type Dependancies []Dependancy

func (Dependancies) Check

func (f Dependancies) Check() error

func (*Dependancies) Parse

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

func (Dependancies) String

func (f Dependancies) String() string

type Dependancy

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

func (Dependancy) String

func (dep Dependancy) String() string

type Field

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

type Name

type Name string

func (Name) Check

func (n Name) Check() error

func (*Name) Parse

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

func (Name) String

func (n Name) String() string

type Package

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

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

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

type PackageInfo

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

type Priority

type Priority int

func (*Priority) Check

func (f *Priority) Check() error

func (*Priority) Parse

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

func (Priority) String

func (f Priority) String() string

type Status

type Status struct {
	Want   string
	Flag   string
	Status string
}

func (*Status) Check

func (f *Status) Check() error

func (*Status) Parse

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

func (*Status) String

func (f *Status) String() string

type StatusParser

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

func NewStatus

func NewStatus(r io.Reader) *StatusParser

func (*StatusParser) Packages

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

type Version

type Version version.Version

func (Version) Check

func (f Version) Check() error

func (*Version) Parse

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

func (Version) String

func (f Version) String() string

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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