package module
Version: v0.0.0-...-79d8cb2 Latest Latest

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

Go to latest
Published: Nov 24, 2020 License: MIT Imports: 11 Imported by: 0



a binary package manager (deb, rpm,...)




View Source
const (
	ExtGZ = ".gz"
	ExtXZ = ".xz"
View Source
const (
	DefaultDistrib = "unstable"
	DefaultOS      = "linux"
	DefaultHost    = "localhost.localdomain"
	DefaultUser    = "root"
	DefaultGroup   = "root"
View Source
const (
	Arch32  = 32
	Arch64  = 64
	ArchAll = 0


View Source
var (
	ErrUnsupportedPayloadFormat = errors.New("unsupported payload format")
	ErrMalformedPackage         = errors.New("malformed package")
View Source
var ErrSkip = errors.New("skip")


func ArchString

func ArchString(a uint8) string

func Hostname

func Hostname() string

func IsConfFile

func IsConfFile(n string) bool


type Builder

type Builder interface {
	PackageName() string
	Build(w io.Writer) error

type Change

type Change struct {
	When        time.Time `toml:"date"`
	Body        string    `toml:"description"`
	Version     string    `toml:'version'`
	Distrib     []string  `toml:"distrib"`
	Changes     []Change  `toml:"changes"`
	*Maintainer `toml:"maintainer"`

type Control

type Control struct {
	Package     string `toml:"package"`
	Version     string `toml:"version"`
	Release     string `toml:"release"`
	Summary     string `toml:"summary"`
	Desc        string `toml:"description"`
	License     string `toml:"license"`
	Section     string `toml:"section"`
	Priority    string `toml:"priority"`
	Os          string `toml:"os"`
	Arch        uint8  `toml:"arch"`
	Vendor      string `toml:"vendor"`
	Home        string `toml:"homepage"`
	*Maintainer `toml:"maintainer"`

	Depends   []string `toml:"depends"`
	Suggests  []string `toml:"suggests"`
	Provides  []string `toml:"provides"`
	Breaks    []string `toml:"breaks"`
	Conflicts []string `toml:"conflicts"`
	Replaces  []string `toml:"replaces"`

	Compiler string `toml:"compiler"`

	Format string    `toml:"-"`
	Status string    `toml:"-"`
	Source string    `toml:"-"`
	Date   time.Time `toml:"-"`
	Size   int64     `toml:"-"`

func (Control) PackageName

func (c Control) PackageName() string

type File

type File struct {
	Src      string `toml:"source"`
	Dst      string `toml:"destination"`
	Name     string `toml:"filename"`
	Compress bool   `toml:"compress"`
	Perm     int    `toml:"mode"`

	Conf    bool   `toml:"conf"`
	Doc     bool   `toml:"doc"`
	License bool   `toml:"license"`
	Readme  bool   `toml:"readme"`
	Lang    string `toml:"lang"`

	Sum  string `toml:"-"`
	Size int64  `toml:"-"`

func LocalFile

func LocalFile(p string) (*File, error)

func (File) Filename

func (f File) Filename() string

func (File) Mode

func (f File) Mode() int64

func (File) String

func (f File) String() string

type History

type History []Change

func (History) All

func (h History) All() []Change

func (History) Between

func (h History) Between(fd, td time.Time) []Change

func (History) Filter

func (h History) Filter(who string, fd, td time.Time) []Change

type Maintainer

type Maintainer struct {
	Name  string `toml:"name"`
	Email string `toml:"email"`
var DefaultMaintainer Maintainer

func ParseMaintainer

func ParseMaintainer(s string) (*Maintainer, error)

func ParseMaintainerVersion

func ParseMaintainerVersion(s string) (*Maintainer, string, error)

func (*Maintainer) String

func (m *Maintainer) String() string

type Makefile

type Makefile struct {
	*Control `toml:"metadata"`
	Files    []*File   `toml:"resource"`
	Changes  []*Change `toml:"changelog"`

	Preinst  *Script `toml:"pre-install"`
	Postinst *Script `toml:"post-install"`
	Prerm    *Script `toml:"pre-remove"`
	Postrm   *Script `toml:"post-remove"`

type Package

type Package interface {
	PackageName() string
	PackageType() string
	About() Control
	History() History
	Filenames() ([]string, error)
	Resources() ([]Resource, error)
	Valid() error
	Extract(string, bool) error

type Resource

type Resource struct {
	Name    string
	Size    int64
	Perm    int64
	ModTime time.Time

type Script

type Script struct {
	Text code `toml:"script"`

func (*Script) String

func (s *Script) String() string

func (*Script) Valid

func (s *Script) Valid() bool


Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
t or T : Toggle theme light dark auto
y or Y : Canonical URL