packit

package module
v0.2.2 Latest Latest
Warning

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

Go to latest
Published: Mar 13, 2022 License: MIT Imports: 18 Imported by: 0

README

mack

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

Documentation

Index

Constants

View Source
const (
	EnvArchive = "archive"
	EnvBash    = "bash"
	EnvShell   = "shell"
	EnvPwsh    = "pwsh"
	EnvPython  = "python"
	EnvPerl    = "perl"
)
View Source
const (
	DEB = "deb"
	RPM = "rpm"
	APK = "apk"
)
View Source
const (
	Root       = "root"
	Shebang    = "#!"
	Bash       = "/bin/bash"
	Shell      = "/bin/sh"
	Powershell = "/usr/bin/pwsh"
	Python     = "/usr/bin/env python3"
	Perl       = "/usr/bin/perl"
)
View Source
const (
	Changelog = "CHANGELOG"
	License   = "LICENSE"
	Readme    = "README"
)
View Source
const (
	Arch64 = 64
	Arch32 = 32
)
View Source
const (
	DefaultVersion  = "0.1.0"
	DefaultLicense  = "mit"
	DefaultSection  = "contrib"
	DefaultPriority = "extra"
	DefaultOS       = "linux"
	DefaultShebang  = "#!/bin/sh"
)
View Source
const (
	EnvMaintainerName = "PACKIT_MAINTAINER_NAME"
	EnvMaintainerMail = "PACKIT_MAINTAINER_MAIL"
)

Variables

View Source
var ErrPackage = errors.New("unsupported package type")

Functions

func Arch added in v0.2.0

func Arch(a int) string

func GetLicense

func GetLicense(name string, meta Metadata) (string, error)

func Hostname

func Hostname() string

Types

type Change

type Change struct {
	Title      string
	Desc       string `fig:"description"`
	Version    string
	When       time.Time
	Maintainer Maintainer
}

type Condition

type Condition int
const (
	Eq Condition = 1 << iota
	Lt
	Le
	Gt
	Ge
)

type Dependency

type Dependency struct {
	Name    string
	Version string
	Cond    Condition
}

func ParseDependency

func ParseDependency(str string) (Dependency, error)

func (*Dependency) Set

func (d *Dependency) Set(str string) error

func (Dependency) String

func (d Dependency) String() string

type Maintainer

type Maintainer struct {
	Name  string
	Email string
}

func (Maintainer) IsZero

func (m Maintainer) IsZero() bool

func (Maintainer) String

func (m Maintainer) String() string

type Metadata

type Metadata struct {
	Package  string
	Version  string
	Release  string
	Summary  string
	Desc     string `fig:"description"`
	License  string
	Section  string
	Priority string
	OS       string
	Arch     int
	Vendor   string
	Home     string `fig:"homepage"`
	Compiler string

	Maintainer Maintainer

	Resources []Resource `fig:"resource"`
	Changes   []Change   `fig:"change"`

	Essential  bool
	Depends    []Dependency `fig:"depend"`
	Suggests   []Dependency `fig:"suggest"`
	Provides   []Dependency `fig:"provide"`
	Breaks     []Dependency `fig:"break"`
	Conflicts  []Dependency `fig:"conflict"`
	Replaces   []Dependency `fig:"replace"`
	Requires   []Dependency `fig:"require"`
	Recommands []Dependency `fig:"recommand"`
	Obsoletes  []Dependency `fig:"obsolet"`

	PreInst  Script `fig:"pre-install"`
	PostInst Script `fig:"post-install"`
	PreRem   Script `fig:"pre-remove"`
	PostRem  Script `fig:"post-remove"`

	Date     time.Time `fig:"-"`
	Size     int64     `fig:"-"`
	DataHash string    `fig:"-"`
}

func Load

func Load(r io.Reader, kind string) (Metadata, error)

func (*Metadata) HasChangelog

func (m *Metadata) HasChangelog() bool

func (*Metadata) HasLicense

func (m *Metadata) HasLicense() bool

func (Metadata) PackageName

func (m Metadata) PackageName() string

func (*Metadata) Update

func (m *Metadata) Update(_ fig.Resolver) error

type Resource

type Resource struct {
	File     string
	Perm     int
	Archive  string `fig:"archive"`
	Compress bool
	Lang     string

	Inline  bool      `fig:"-"`
	Digest  string    `fig:"-"`
	Size    int64     `fig:"-"`
	ModTime time.Time `fig:"-"`
}

func (Resource) IsConfig

func (r Resource) IsConfig() bool

func (Resource) IsDoc

func (r Resource) IsDoc() bool

func (Resource) IsLicense

func (r Resource) IsLicense() bool

func (Resource) IsReadme

func (r Resource) IsReadme() bool

func (Resource) IsRegular

func (r Resource) IsRegular() bool

func (Resource) Path

func (r Resource) Path() string

func (*Resource) Update

func (r *Resource) Update(res fig.Resolver) error

implements fig.Updater interface

type Script

type Script struct {
	Program string
	Code    string `fig:"script"`
	Digest  string
}

func (*Script) Update

func (s *Script) Update(_ fig.Resolver) error

implements fig.Updater

Directories

Path Synopsis
cmd

Jump to

Keyboard shortcuts

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