Help us shape the future of Go! Take the 2026 Go Developer Survey

binpkg

package
v0.57.29 Latest Latest
Warning

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

Go to latest
Published: Oct 26, 2026 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Overview

Package binpkg reads Gentoo binary packages: the Packages index of a binary package directory, the runtime closure of a set of packages, and the files of each GPKG archive split into runtime and dev layers.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AtomName

func AtomName(atom string) string

AtomName returns the category and name of a dependency atom, dropping its version operator, version, slot and USE dependencies.

func Depends

func Depends(pkgs map[string]*Package, provided map[string]bool, pkg *Package) []string

Depends returns the names of the packages pkg needs at runtime that pkgs holds, in the order its dependency string lists them. In an any-of group the first alternative present in pkgs is chosen; blockers and provided packages are dropped.

func ReadIndex

func ReadIndex(r io.Reader) (map[string]*Package, error)

ReadIndex parses a Packages index into its package entries by name. The header stanza is skipped. Later entries for the same name replace earlier ones, so the result holds the newest build of each package.

Types

type Archive

type Archive struct {
	// Description is the package's one-line description.
	Description string
	// Runtime holds the files the package needs to run.
	Runtime []*layer.Entry
	// Dev holds the headers, static libraries, build metadata and
	// documentation needed only to build against the package.
	Dev []*layer.Entry
}

Archive is the content of a GPKG binary package.

func ReadArchive

func ReadArchive(gpkgPath string) (*Archive, error)

ReadArchive reads the description and installed files of the GPKG binary package at gpkgPath. A package with no image, such as a virtual, installs no files. Paths under /bin, /sbin and /lib move under /usr, and hard links become copies of their target, which content addressing stores once.

type Package

type Package struct {
	// CPV is the category, name and version, such as app-editors/nano-9.2.
	CPV string
	// Name is the category and name, such as app-editors/nano.
	Name string
	// Version is the version and revision, such as 9.2-r1.
	Version string
	// License is the license expression.
	License string
	// RDepend is the runtime dependency string with USE conditionals resolved.
	RDepend string
	// Path is the binary package path relative to the package directory.
	Path string
}

Package is one binary package entry of a Packages index.

func Resolve

func Resolve(pkgs map[string]*Package, provided map[string]bool, names []string) ([]*Package, error)

Resolve returns the runtime closure of the named packages, each package after the packages it depends on. A provided package, one the profile's package.provided lists, is satisfied without installing.

Jump to

Keyboard shortcuts

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