parser

package
v0.0.0-...-c4e951e Latest Latest
Warning

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

Go to latest
Published: May 5, 2024 License: AGPL-3.0 Imports: 6 Imported by: 0

Documentation

Overview

Package parser implements a parser for parsing binhost files, primarily Packages and gpkg files.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Index

type Index struct {
	AcceptLicense         string   `colon:"ACCEPT_LICENSE"`
	AcceptProperties      string   `colon:"ACCEPT_PROPERTIES"`
	AcceptRestrict        string   `colon:"ACCEPT_RESTRICT"`
	AcceptKeywords        []string `colon:"ACCEPT_KEYWORDS"`
	Arch                  string   `colon:"ARCH"`
	CBuild                string   `colon:"CBUILD"`
	CHost                 string   `colon:"CHOST"`
	ConfigProtect         []string `colon:"CONFIG_PROTECT"`
	ConfigProtectMask     []string `colon:"CONFIG_PROTECT_MASK"`
	ELibc                 string   `colon:"ELIBC"`
	Features              []string `colon:"FEATURES"`
	GentooMirrors         string   `colon:"GENTOO_MIRRORS"`
	IUseImplicit          string   `colon:"IUSE_IMPLICIT"`
	Kernel                string   `colon:"KERNEL"`
	Packages              int      `colon:"PACKAGES"`
	Profile               string   `colon:"PROFILE"`
	Timestamp             int      `colon:"TIMESTAMP"`
	Use                   string   `colon:"USE"`
	UseExpand             []string `colon:"USE_EXPAND"`
	UseExpandHidden       []string `colon:"USE_EXPAND_HIDDEN"`
	UseExpandImplicit     []string `colon:"USE_EXPAND_IMPLICIT"`
	UseExpandUnprefixed   []string `colon:"USE_EXPAND_UNPREFIXED"`
	UseExpandValuesArch   []string `colon:"USE_EXPAND_VALUES_ARCH"`
	UseExpandValuesELibc  []string `colon:"USE_EXPAND_VALUES_ELIBC"`
	UseExpandValuesKernel []string `colon:"USE_EXPAND_VALUES_KERNEL"`
	Version               int      `colon:"VERSION"`

	// PackageEntries is a slice of packages contained within the index.
	PackageEntries []Package
}

Index is a binhost index file (Packages).

func ParsePackages

func ParsePackages(r io.Reader) (*Index, error)

ParsePackages parses the provided reader into a the Index type.

func (Index) EncodeInto

func (index Index) EncodeInto(w io.Writer) error

EncodeInto serializes the packages into the given writer using the standard Packages format.

See: https://wiki.gentoo.org/wiki/Binary_package_guide

type Package

type Package struct {
	PackageCommon

	CPV          string `colon:"CPV"`
	Path         string `colon:"PATH"`
	SHA1         string `colon:"SHA1"`
	MD5          string `colon:"MD5"`
	ModifiedTime int    `colon:"MTIME"`
}

Package is a Gentoo binhost package.

func (*Package) EncodeInto

func (pkg *Package) EncodeInto(w io.Writer) error

EncodeInto serializes the package into the given writer using the standard Package format.

type PackageCommon

type PackageCommon struct {
	BDepends      string   `colon:"BDEPEND"`
	BuildID       string   `colon:"BUILD_ID"`
	BuildTime     string   `colon:"BUILD_TIME"`
	DefinedPhases []string `colon:"DEFINED_PHASES"`
	EAPI          int      `colon:"EAPI"`
	ELibc         string   `colon:"ELIBC"`
	IUse          string   `colon:"IUSE"`
	Use           string   `colon:"USE"`
	Keywords      []string `colon:"KEYWORDS"`
	Licenses      []string `colon:"LICENSE"`
	Slot          string   `colon:"SLOT"`
	Depends       string   `colon:"DEPEND"`
	IDepend       string   `colon:"IDEPEND"`
	PDepends      string   `colon:"PDEPEND"`
	RDepends      string   `colon:"RDEPEND"`
	Requires      []string `colon:"REQUIRES"`
	Restrict      string   `colon:"RESTRICT"`
	Provides      []string `colon:"PROVIDES"`
	Size          int      `colon:"SIZE"`
	Repo          string   `colon:"REPO"`
}

PackageCommon is data shared between both a Packages index and the actual package's metadata.tar.xz distributed with it.

Jump to

Keyboard shortcuts

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