deb

package
v0.6.1 Latest Latest
Warning

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

Go to latest
Published: Nov 25, 2026 License: AGPL-3.0 Imports: 17 Imported by: 3 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package deb builds a .deb from a directory and reads metadata back out of an existing one, all in-process: no dpkg, no external tooling. The ar container and gzip tarballs it writes are exactly what chisel's own reader consumes.

Doing this by hand is deliberate. chisel-proxy has to hold a .deb before chisel is asked anything, and chisel keeps its own deb code internal. A tool that only wants to know what a package holds should cut it with chisel.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Arches added in v0.5.0

func Arches() []string

Arches lists every Debian architecture chisel accepts, in the order ubuntu lists them. The slice is the caller's to keep.

func InferArch

func InferArch() (string, error)

InferArch returns the Debian architecture for the running platform.

func ValidArch

func ValidArch(arch string) bool

ValidArch reports whether arch is a Debian architecture chisel accepts.

func Words added in v0.6.0

func Words(arch string) []string

Words lists what names arch as a word of a path, its own name first, or nil for an architecture chisel does not accept. Two architectures may share a word. The slice is the caller's to keep.

Types

type Defaults

type Defaults struct {
	Name    string
	Version string
	Arch    string
}

Defaults fill in control fields when a packed directory carries no DEBIAN/control of its own.

type Package

type Package struct {
	Name    string
	Version string
	Arch    string
	Control string   // full control stanza text
	Files   []string // absolute install paths in data.tar (e.g. /usr/bin/foo)
	Data    []byte   // raw .deb bytes
	SHA256  string   // lowercase-hex digest of Data
	Size    int
}

Package is one .deb ready to be served: metadata, the install paths it carries, and the raw archive bytes.

func FromDir

func FromDir(dir string, def Defaults) (*Package, error)

FromDir packs dir into a .deb. If dir/DEBIAN/control exists it is used verbatim; otherwise a minimal control stanza is fabricated from def. Files under DEBIAN/ are package metadata, everything else is payload.

func FromFile

func FromFile(p string) (*Package, error)

FromFile reads an existing .deb: its control metadata and install paths, plus the raw bytes for serving.

Jump to

Keyboard shortcuts

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