mkdeb

package module
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Mar 8, 2023 License: BSD-2-Clause Imports: 24 Imported by: 0

README

mkdeb

Go library for creating Debian binary packages

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Main

func Main(stdout io.Writer, stderr io.Writer, argv []string) int

func SetVersion added in v0.1.1

func SetVersion(pairs ...string)

Types

type Builder

type Builder struct {
	Root        fs.FS
	ZeroTime    time.Time
	Compression CompressAlgorithm
	Hashes      []HashAlgorithm
}

func (Builder) Build

func (builder Builder) Build(w io.Writer, manifest *Manifest) error

func (Builder) BuildControlTarball

func (builder Builder) BuildControlTarball(w io.Writer, manifest *Manifest) error

func (Builder) BuildDataTarball

func (builder Builder) BuildDataTarball(w io.Writer, manifest *Manifest) error

type CompressAlgorithm

type CompressAlgorithm byte
const (
	CompressAuto CompressAlgorithm = iota
	CompressNone
	CompressGZIP
	CompressBZIP2
	CompressXZ
	CompressZSTD
)

func (CompressAlgorithm) GoString

func (algo CompressAlgorithm) GoString() string

func (CompressAlgorithm) MarshalText

func (algo CompressAlgorithm) MarshalText() ([]byte, error)

func (CompressAlgorithm) NewWriter

func (algo CompressAlgorithm) NewWriter(w io.Writer) (io.WriteCloser, error)

func (*CompressAlgorithm) Parse

func (algo *CompressAlgorithm) Parse(input string) error

func (*CompressAlgorithm) Set

func (algo *CompressAlgorithm) Set(value string, opt getopt.Option) error

func (CompressAlgorithm) String

func (algo CompressAlgorithm) String() string

func (CompressAlgorithm) Suffix

func (algo CompressAlgorithm) Suffix() string

func (*CompressAlgorithm) UnmarshalText

func (algo *CompressAlgorithm) UnmarshalText(input []byte) error

type File

type File struct {
	Name   string    `json:"name"`
	Type   Type      `json:"type"`
	IsConf bool      `json:"isConf"`
	Perm   Perm      `json:"perm"`
	User   Owner     `json:"user"`
	Group  Owner     `json:"group"`
	MTime  time.Time `json:"mtime"`
	Major  *int64    `json:"major"`
	Minor  *int64    `json:"minor"`
	Path   *string   `json:"path"`
	Text   *string   `json:"text"`
	Bytes  *[]byte   `json:"bytes"`
	Link   *string   `json:"link"`
	// contains filtered or unexported fields
}

func (File) AsTarHeader

func (file File) AsTarHeader() tar.Header

func (File) Reader

func (file File) Reader(fileSystem fs.FS) (io.ReadCloser, error)

func (*File) Resolve

func (file *File) Resolve(fileSystem fs.FS) error

func (File) Validate

func (file File) Validate() error

type HashAlgorithm

type HashAlgorithm byte
const (
	HashMD5 HashAlgorithm = iota
	HashSHA1
	HashSHA256
)

func (HashAlgorithm) FileName

func (algo HashAlgorithm) FileName() string

func (HashAlgorithm) GoString

func (algo HashAlgorithm) GoString() string

func (HashAlgorithm) MarshalText

func (algo HashAlgorithm) MarshalText() ([]byte, error)

func (HashAlgorithm) New

func (algo HashAlgorithm) New() hash.Hash

func (*HashAlgorithm) Parse

func (algo *HashAlgorithm) Parse(input string) error

func (*HashAlgorithm) Set

func (algo *HashAlgorithm) Set(value string, opt getopt.Option) error

func (HashAlgorithm) String

func (algo HashAlgorithm) String() string

func (*HashAlgorithm) UnmarshalText

func (algo *HashAlgorithm) UnmarshalText(input []byte) error

type Manifest

type Manifest struct {
	Package          string   `json:"package"`
	Version          string   `json:"version"`
	Arch             string   `json:"arch"`
	Section          string   `json:"section"`
	Priority         string   `json:"priority"`
	Essential        string   `json:"essential"`
	Depends          string   `json:"depends"`
	PreDepends       string   `json:"preDepends"`
	Recommends       string   `json:"recommends"`
	Suggests         string   `json:"suggests"`
	Enhances         string   `json:"enhances"`
	Breaks           string   `json:"breaks"`
	Conflicts        string   `json:"conflicts"`
	Maintainer       string   `json:"maintainer"`
	HomePage         string   `json:"homePage"`
	BuiltUsing       string   `json:"builtUsing"`
	ShortDescription string   `json:"shortDescription"`
	LongDescription  []string `json:"longDescription"`
	ImplicitDirs     []string `json:"implicitDirs"`
	Files            []File   `json:"files"`
	PreInstall       []string `json:"preInstall"`
	PostInstall      []string `json:"postInstall"`
	PreRemove        []string `json:"preRemove"`
	PostRemove       []string `json:"postRemove"`
	// contains filtered or unexported fields
}

func (Manifest) ConfFiles

func (manifest Manifest) ConfFiles() []byte

func (Manifest) ControlFile

func (manifest Manifest) ControlFile() []byte

func (Manifest) PostInstallScript

func (manifest Manifest) PostInstallScript() []byte

func (Manifest) PostRemoveScript

func (manifest Manifest) PostRemoveScript() []byte

func (Manifest) PreInstallScript

func (manifest Manifest) PreInstallScript() []byte

func (Manifest) PreRemoveScript

func (manifest Manifest) PreRemoveScript() []byte

func (*Manifest) Resolve

func (manifest *Manifest) Resolve(fileSystem fs.FS) error

func (Manifest) Validate

func (manifest Manifest) Validate() error

type Owner

type Owner struct {
	Type OwnerType
	ID   int
	Name string
}

func ID

func ID(id int) Owner

func Name

func Name(name string) Owner

func (Owner) Equal

func (owner Owner) Equal(other Owner) bool

func (Owner) GoString

func (owner Owner) GoString() string

func (Owner) IsZero

func (owner Owner) IsZero() bool

func (Owner) MarshalJSON

func (owner Owner) MarshalJSON() ([]byte, error)

func (Owner) MarshalText

func (owner Owner) MarshalText() ([]byte, error)

func (*Owner) Parse

func (owner *Owner) Parse(input string) error

func (Owner) String

func (owner Owner) String() string

func (*Owner) UnmarshalJSON

func (owner *Owner) UnmarshalJSON(input []byte) error

func (*Owner) UnmarshalText

func (owner *Owner) UnmarshalText(input []byte) error

type OwnerType

type OwnerType byte
const (
	OwnerUnspecified OwnerType = iota
	OwnerByID
	OwnerByName
)

type Perm

type Perm uint16

func (Perm) AppendTo

func (perm Perm) AppendTo(out []byte) []byte

func (Perm) GoString

func (perm Perm) GoString() string

func (Perm) MarshalText

func (perm Perm) MarshalText() ([]byte, error)

func (*Perm) Parse

func (perm *Perm) Parse(input string) error

func (Perm) String

func (perm Perm) String() string

func (*Perm) UnmarshalJSON

func (perm *Perm) UnmarshalJSON(input []byte) error

func (*Perm) UnmarshalText

func (perm *Perm) UnmarshalText(input []byte) error

type Type

type Type byte
const (
	TypeAUTO Type = iota
	TypeDIR
	TypeREG
	TypeLNK
	TypeFIFO
	TypeCHR
	TypeBLK
)

func (Type) GoString

func (ft Type) GoString() string

func (Type) IsValid

func (ft Type) IsValid() bool

func (Type) MarshalText

func (ft Type) MarshalText() ([]byte, error)

func (*Type) Parse

func (ft *Type) Parse(input string) error

func (Type) String

func (ft Type) String() string

func (*Type) UnmarshalText

func (ft *Type) UnmarshalText(input []byte) error

Directories

Path Synopsis
cmd

Jump to

Keyboard shortcuts

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