Documentation
¶
Index ¶
- Constants
- Variables
- func CompareVersions(v1, v2 string) int
- func ExtractPackageNameFromDep(dep string) string
- func FetchMainGentooCategories() map[string]bool
- func PadVersionTokens(v string) string
- func ParseEbuildVariables(filename string) map[string]string
- func ParseIUSE(iuseStr string) []string
- func ParseInfoVars(path string) ([]string, error)
- func ParseInfoVarsFS(sysFS fs.FS, path string) ([]string, error)
- func ParseLicense(licenseStr string) []string
- func ParseLicenseGroups(r io.Reader) (map[string][]string, error)
- func ParseMetadata(path string) (interface{}, error)
- func ParseMetadataBytes(data []byte) (interface{}, error)
- func ParseMetadataFromReader(r io.Reader) (interface{}, error)
- func ParseThirdPartyMirrors(path string) (map[string][]string, error)
- func ParseThirdPartyMirrorsFS(sysFS fs.FS, path string) (map[string][]string, error)
- func ParseThirdPartyMirrorsFromReader(r io.Reader) (map[string][]string, error)
- func ResolveVariables(text string, variables map[string]string) string
- func SerializeInfoPkgs(w io.Writer, pkgs []InfoPkg) error
- func SerializeInfoVars(w io.Writer, vars []string) error
- func SerializePackageDeprecated(w io.Writer, deprecated []PackageDeprecated) error
- func StripEmail(s string) string
- func UpsertManifest(manifestPath string, newEntry *ManifestEntry) error
- func WriteInfoVarsFile(path string, vars []string) error
- func WriteLayoutConf(lc *LayoutConf, path string) error
- func WriteMetadata(path string, data interface{}) error
- func WriteUpdatesFile(path string, update *PackageUpdate) error
- type AST
- type Affected
- type Author
- type Background
- type Breadcrumb
- type Cat
- type CatMetadata
- type CategoryData
- type Checksums
- type DepAllOf
- type DepAnyOf
- type DepNode
- type DepString
- type DepTree
- type DepUseConditional
- type Description
- type Doc
- type DownloadProgress
- type Ebuild
- type EbuildParser
- type Email
- type EvaluateConfig
- type Familyname
- type Feed
- type FeedItem
- type FileData
- type Flag
- type GLSA
- type GLSADescription
- type GLSAMetadata
- type GentooVersion
- type Hash
- type IgnoreUseFlags
- type Impact
- type InfoPkg
- type LayoutConf
- type LayoutConfEntry
- type License
- type LicenseData
- type Location
- type LongDescription
- type Maintainer
- type Manifest
- type ManifestEntry
- type Member
- type Mirror
- type MirrorGroup
- type MirrorURI
- type Mirrors
- type Name
- type NewsItem
- type NewsNode
- type NewsNodeType
- type Package
- type PackageAtom
- type PackageData
- type PackageDeprecated
- type PackageMove
- type PackageSlotMove
- type PackageUpdate
- type ParseError
- type ParsedEbuild
- type ParsingMode
- type Part
- type Pkg
- type PkgDescIndex
- type PkgDescIndexEntry
- type PkgMetadata
- type Position
- type Product
- type Project
- type Projects
- type QAPolicy
- type Reader
- type Realname
- type References
- type RemoteID
- type Repositories
- type Repository
- type RepositoryDescription
- type RepositoryOwner
- type RepositorySource
- type RequiredUseAllOf
- type RequiredUseAnyOf
- type RequiredUseAtMostOneOf
- type RequiredUseConditional
- type RequiredUseConfig
- type RequiredUseExactlyOneOf
- type RequiredUseFlag
- type RequiredUseNode
- type RequiredUseOption
- type Resolution
- type Revised
- type Service
- type SiteData
- type Slot
- type Slots
- type StabilizeAllArches
- type Subproject
- type URI
- type URIEntry
- type Unaffected
- type Upstream
- type Use
- type UseDesc
- type UseFlag
- type UseFlags
- type UseLocalDesc
- type User
- type UserList
- type VersionData
- type Vulnerable
- type Workaround
Constants ¶
const ( HashBlake2b = "BLAKE2B" HashBlake2s = "BLAKE2S" HashMd5 = "MD5" HashRmd160 = "RMD160" HashSha1 = "SHA1" HashSha256 = "SHA256" HashSha3_256 = "SHA3_256" HashSha3_512 = "SHA3_512" HashSha512 = "SHA512" )
Variables ¶
var ( ErrUnexpectedEOF = errors.New("unexpected EOF") ErrSyntaxError = errors.New("syntax error") )
var AllHashes = []string{ HashBlake2b, HashBlake2s, HashMd5, HashRmd160, HashSha1, HashSha256, HashSha3_256, HashSha3_512, HashSha512, }
Functions ¶
func CompareVersions ¶ added in v0.0.20
CompareVersions compares two gentoo versions strictly adhering to PMS. Returns > 0 if v1 > v2, < 0 if v1 < v2, and 0 if equal.
func ExtractPackageNameFromDep ¶ added in v0.0.29
ExtractPackageNameFromDep strips version, slot, and USE flags from a package string using the AST parser PackageAtom to satisfy architectural requirements.
func FetchMainGentooCategories ¶ added in v0.0.32
func PadVersionTokens ¶ added in v0.0.24
PadVersionTokens produces a sortable string representation of a gentoo version.
func ParseEbuildVariables ¶
ParseEbuildVariables extracts PN, PV, P from the ebuild filename.
func ParseIUSE ¶ added in v0.0.19
ParseIUSE extracts the actual USE flag names from an IUSE string, stripping prefixes like + and -.
func ParseInfoVars ¶ added in v0.0.28
ParseInfoVars parses a profiles/info_vars file from the local filesystem.
func ParseInfoVarsFS ¶ added in v0.0.28
ParseInfoVarsFS parses a profiles/info_vars file from a filesystem.
func ParseLicense ¶ added in v0.0.27
ParseLicense extracts individual license names from a LICENSE string, evaluating all conditionals to true to gather all possible licenses.
func ParseLicenseGroups ¶ added in v0.0.28
ParseLicenseGroups parses a profiles/license_groups file. It returns a map where the key is the alias/group name, and the value is a list of target licenses that map to it.
func ParseMetadata ¶
ParseMetadata parses a metadata.xml file and returns either a PkgMetadata or CatMetadata pointer (as interface{}), or an error.
func ParseMetadataBytes ¶
ParseMetadataBytes parses metadata from a byte slice.
func ParseMetadataFromReader ¶
ParseMetadataFromReader parses metadata from an io.Reader.
func ParseThirdPartyMirrors ¶ added in v0.0.28
ParseThirdPartyMirrors parses a thirdpartymirrors file from a path
func ParseThirdPartyMirrorsFS ¶ added in v0.0.28
ParseThirdPartyMirrorsFS parses a thirdpartymirrors file from an fs.FS
func ParseThirdPartyMirrorsFromReader ¶ added in v0.0.28
ParseThirdPartyMirrorsFromReader parses a thirdpartymirrors file from an io.Reader It returns a map of mirror name to a list of mirror URLs.
func ResolveVariables ¶
ResolveVariables replaces ${VAR} and $VAR in the text with values from variables map.
func SerializeInfoVars ¶ added in v0.0.28
SerializeInfoVars writes a list of variables to an io.Writer.
func SerializePackageDeprecated ¶ added in v0.0.20
func SerializePackageDeprecated(w io.Writer, deprecated []PackageDeprecated) error
func StripEmail ¶ added in v0.0.30
StripEmail removes the email portion "<[email protected]>" from a string.
func UpsertManifest ¶
func UpsertManifest(manifestPath string, newEntry *ManifestEntry) error
UpsertManifest updates or inserts a manifest entry.
func WriteInfoVarsFile ¶ added in v0.0.28
WriteInfoVarsFile writes a list of variables to a file on the local filesystem.
func WriteLayoutConf ¶ added in v0.0.17
func WriteLayoutConf(lc *LayoutConf, path string) error
WriteLayoutConf writes a LayoutConf back to a file
func WriteMetadata ¶
WriteMetadata writes the metadata to a file with proper headers.
func WriteUpdatesFile ¶ added in v0.0.20
func WriteUpdatesFile(path string, update *PackageUpdate) error
Types ¶
type Author ¶ added in v0.0.17
Author represents an entry in the metadata/AUTHORS file.
func ParseAuthors ¶ added in v0.0.17
ParseAuthors parses the metadata/AUTHORS file format. It ignores blank lines and comments starting with '#'. Expected format: "Name <[email protected]>" or just "Name".
type Background ¶ added in v0.0.15
type Background struct {
Text string `xml:",innerxml"`
}
type Breadcrumb ¶ added in v0.0.19
type Cat ¶
type Cat struct {
// Text of the category.
Text string `xml:",innerxml"`
}
Cat represents a cross-linking category. Note: This struct is not directly used in LongDescription to preserve mixed content via InnerXML, but is provided as part of the model definition.
type CatMetadata ¶
type CatMetadata struct {
XMLName xml.Name `xml:"catmetadata"`
LongDescription []LongDescription `xml:"longdescription"`
}
CatMetadata represents metadata for a category. Source: https://github.com/gentoo-mirror/gentoo/blob/stable/metadata/dtd/metadata.dtd
func (*CatMetadata) String ¶
func (c *CatMetadata) String() string
type CategoryData ¶ added in v0.0.19
type CategoryData struct {
Name string
Packages []PackageData
}
type DepTree ¶ added in v0.0.27
type DepTree struct {
Nodes []DepNode
}
func ParseDepTree ¶ added in v0.0.27
ParseDepTree parses a dependency string (like DEPEND, RDEPEND, LICENSE) into an AST that can be evaluated with Evaluate().
type DepUseConditional ¶ added in v0.0.27
type Description ¶
type Description struct {
// Text of the description.
Text string `xml:",innerxml"`
}
Description represents a description of a maintainer or change.
type Doc ¶
type Doc struct {
// URL of the documentation.
URL string `xml:",chardata"`
// Lang specifies the language of the documentation.
Lang string `xml:"lang,attr,omitempty"`
}
Doc represents a documentation URL.
type DownloadProgress ¶
type Ebuild ¶
type Ebuild struct {
Path string
Vars map[string]string
Functions map[string]AST
SrcUri []URIEntry
Mode ParsingMode
RawText string
ParseWarnings []string
EbuildHeader string
// contains filtered or unexported fields
}
func ParseEbuild ¶
ParseEbuild parses an ebuild file with the specified mode.
type EbuildParser ¶ added in v0.0.19
type EbuildParser struct {
Warnings []string
// contains filtered or unexported fields
}
EbuildParser implements a recursive descent parser for Gentoo ebuild files.
func NewEbuildParser ¶ added in v0.0.19
func NewEbuildParser(ctx context.Context, reader io.Reader) *EbuildParser
func (*EbuildParser) Parse ¶ added in v0.0.19
func (p *EbuildParser) Parse() (ParsedEbuild, error)
Parse extracts variables and functions from the ebuild using a recursive descent approach tailored specifically for ebuilds, bypassing full bash posix rules.
type Email ¶
type Email struct {
// Text of the email address.
Text string `xml:",innerxml"`
}
Email represents an email address.
type EvaluateConfig ¶ added in v0.0.27
type Familyname ¶ added in v0.0.15
type Flag ¶
type Flag struct {
// Name of the USE flag.
Name string `xml:"name,attr"`
// Text of the flag.
Text string `xml:",innerxml"`
// Restrict specifies restrictions on the applicability of the flag.
Restrict string `xml:"restrict,attr,omitempty"`
}
Flag represents a USE flag.
type GLSA ¶ added in v0.0.15
type GLSA struct {
XMLName xml.Name `xml:"glsa"`
ID string `xml:"id,attr"`
Title string `xml:"title"`
Synopsis string `xml:"synopsis"`
Product Product `xml:"product"`
Announced string `xml:"announced"`
Revised Revised `xml:"revised"`
Bugs []string `xml:"bug"`
Access string `xml:"access,omitempty"`
Affected Affected `xml:"affected"`
Background *Background `xml:"background"`
Description GLSADescription `xml:"description"`
Impact Impact `xml:"impact"`
Workaround Workaround `xml:"workaround"`
Resolution Resolution `xml:"resolution"`
References References `xml:"references"`
License *License `xml:"license"`
Metadata []GLSAMetadata `xml:"metadata"`
}
GLSA represents a Gentoo Linux Security Advisory. Source: https://github.com/gentoo-mirror/gentoo/blob/stable/metadata/dtd/glsa.dtd
func ParseGLSA ¶ added in v0.0.15
ParseGLSA parses a glsa.xml file and returns a GLSA pointer, or an error.
func ParseGLSABytes ¶ added in v0.0.15
ParseGLSABytes parses GLSA from a byte slice.
type GLSADescription ¶ added in v0.0.15
type GLSADescription struct {
Text string `xml:",innerxml"`
}
type GLSAMetadata ¶ added in v0.0.15
type GentooVersion ¶ added in v0.0.23
type GentooVersion struct {
Nums []int
NumStrs []string
Letter string
Suffix string
SuffixNoStr string
SuffixNo int
Revision int
IsValid bool
}
GentooVersion represents a parsed Gentoo package version strictly adhering to PMS rules.
func ParseGentooVersion ¶ added in v0.0.23
func ParseGentooVersion(v string) GentooVersion
ParseGentooVersion parses a gentoo version into parts
func (*GentooVersion) IncrementPart ¶ added in v0.0.23
func (gv *GentooVersion) IncrementPart(parts ...any)
IncrementPart allows incrementing specific parts of the version string based on common bump operations. Supports variadic Part arguments to increment multiple parts sequentially.
func (*GentooVersion) IncrementRevision ¶ added in v0.0.23
func (gv *GentooVersion) IncrementRevision()
IncrementRevision increments the Gentoo version revision number (e.g., -r1 -> -r2).
func (*GentooVersion) String ¶ added in v0.0.23
func (gv *GentooVersion) String() string
String reassembles and serializes the parsed GentooVersion back into a string.
type IgnoreUseFlags ¶ added in v0.0.27
type IgnoreUseFlags bool
type InfoPkg ¶ added in v0.0.28
type InfoPkg struct {
PackageAtom string
}
func ParseInfoPkgs ¶ added in v0.0.28
type LayoutConf ¶ added in v0.0.17
type LayoutConf struct {
Entries []LayoutConfEntry
}
LayoutConf represents the contents of a metadata/layout.conf file
func ParseLayoutConf ¶ added in v0.0.17
func ParseLayoutConf(path string) (*LayoutConf, error)
ParseLayoutConf parses a metadata/layout.conf file
func ParseLayoutConfFromReader ¶ added in v0.0.19
func ParseLayoutConfFromReader(r io.Reader) (*LayoutConf, error)
ParseLayoutConfFromReader parses a layout.conf from an io.Reader
func (*LayoutConf) GetValue ¶ added in v0.0.17
func (lc *LayoutConf) GetValue(key string) string
GetValue returns the value for a specific key
func (*LayoutConf) GetValuesAsSlice ¶ added in v0.0.17
func (lc *LayoutConf) GetValuesAsSlice(key string) []string
GetValuesAsSlice returns the value for a specific key split by spaces
func (*LayoutConf) SetValue ¶ added in v0.0.17
func (lc *LayoutConf) SetValue(key, value string)
SetValue sets the value for a specific key, updating it if it exists or appending if it doesn't
func (*LayoutConf) UnsetValue ¶ added in v0.0.17
func (lc *LayoutConf) UnsetValue(key string)
UnsetValue removes a specific key
type LayoutConfEntry ¶ added in v0.0.17
LayoutConfEntry represents a single key-value entry with its preceding comments
type LicenseData ¶ added in v0.0.19
type LicenseData struct {
Name string
Count int
Packages []PackageData
}
type LongDescription ¶
type LongDescription struct {
// Body contains the inner XML of the long description.
// We use InnerXML to preserve mixed content (text + <pkg>/<cat> tags) and ensure circularity.
Body string `xml:",innerxml"`
// Lang specifies the language of the description.
Lang string `xml:"lang,attr,omitempty"`
// Restrict specifies restrictions on the applicability of the description.
Restrict string `xml:"restrict,attr,omitempty"`
}
LongDescription represents a long description of a package or category.
type Maintainer ¶
type Maintainer struct {
// Email of the maintainer.
Email string `xml:"email"`
// Name of the maintainer.
Name string `xml:"name,omitempty"`
// Description of the maintainer.
Description string `xml:"description,omitempty"`
// Type of the maintainer: person, project, or unknown.
Type string `xml:"type,attr,omitempty"`
// Proxied indicates whether the maintainer is proxied: yes, no, or proxy.
Proxied string `xml:"proxied,attr,omitempty"`
// Status of the upstream maintainer: active, inactive, or unknown.
Status string `xml:"status,attr,omitempty"`
// Restrict specifies restrictions on the applicability of the maintainer.
Restrict string `xml:"restrict,attr,omitempty"`
}
Maintainer represents a maintainer of a package.
type Manifest ¶
type Manifest struct {
Entries []*ManifestEntry
}
func ParseManifest ¶
func ParseManifestContent ¶
func ParseManifestFromReader ¶ added in v0.0.19
ParseManifestFromReader parses a Manifest file from an io.Reader
func (*Manifest) AddOrReplace ¶
func (m *Manifest) AddOrReplace(entry *ManifestEntry)
func (*Manifest) GetEntry ¶
func (m *Manifest) GetEntry(filename string) *ManifestEntry
GetEntry returns the entry for a filename if it exists
type ManifestEntry ¶
func NewManifestEntry ¶
func NewManifestEntry(typeStr, filename string, size int64, hashes ...Hash) *ManifestEntry
func ParseManifestEntry ¶
func ParseManifestEntry(line string) (*ManifestEntry, error)
func (*ManifestEntry) AddHash ¶
func (e *ManifestEntry) AddHash(hType, hValue string)
func (*ManifestEntry) GetHash ¶
func (e *ManifestEntry) GetHash(hType string) string
func (*ManifestEntry) String ¶
func (e *ManifestEntry) String() string
type MirrorGroup ¶ added in v0.0.15
type Mirrors ¶ added in v0.0.15
type Mirrors struct {
XMLName xml.Name `xml:"mirrors"`
MirrorGroups []MirrorGroup `xml:"mirrorgroup"`
}
Mirrors represents a set of mirror groups. Source: https://github.com/gentoo-mirror/gentoo/blob/stable/metadata/dtd/mirrors.dtd
func ParseMirrors ¶ added in v0.0.15
ParseMirrors parses a mirrors.xml file and returns a Mirrors pointer, or an error.
func ParseMirrorsBytes ¶ added in v0.0.15
ParseMirrorsBytes parses Mirrors from a byte slice.
type Name ¶
type Name struct {
// Text of the name.
Text string `xml:",innerxml"`
}
Name represents a name of a person or maintainer.
type NewsItem ¶ added in v0.0.30
type NewsItem struct {
Title string
Author string
Translator []string
Posted time.Time
Revision string
NewsItemFormat string
DisplayIfInstalled []string
DisplayIfKeyword []string
DisplayIfProfile []string
Body string
BodyAST []NewsNode
DirName string
FileName string
}
NewsItem represents a parsed Gentoo News Item (GLEP 42).
func ParseNewsItem ¶ added in v0.0.30
ParseNewsItem parses the content of a Gentoo news file into a NewsItem structure.
func (NewsItem) ToHTMLTemplate ¶ added in v0.0.30
ToHTMLTemplate converts the NewsItem body into an HTML template representation.
type NewsNode ¶ added in v0.0.30
type NewsNode struct {
Type NewsNodeType
Lines []string // Contains the text for text/code, or list items
}
NewsNode represents a single abstract syntax tree element in a news item body.
type NewsNodeType ¶ added in v0.0.30
type NewsNodeType int
NewsNodeType identifies the type of an AST node in a news item body.
const ( NewsNodeText NewsNodeType = iota NewsNodeList NewsNodeCode )
type Package ¶ added in v0.0.15
type Package struct {
Name string `xml:"name,attr"`
Auto string `xml:"auto,attr"` // yes|no
Arch string `xml:"arch,attr"`
Vulnerable []Vulnerable `xml:"vulnerable"`
Unaffected []Unaffected `xml:"unaffected"`
}
type PackageAtom ¶ added in v0.0.29
type PackageAtom struct {
Operator string // e.g. ">=", "~", "!", "!!", ""
Category string // e.g. "dev-lang"
Name string // e.g. "python"
Version string // e.g. "3.10.4-r1"
Slot string // e.g. "0/3.10"
UseFlags string // e.g. "sqlite,xml"
}
PackageAtom represents a parsed Gentoo package dependency specification.
func ParsePackageAtom ¶ added in v0.0.29
func ParsePackageAtom(dep string) PackageAtom
ParsePackageAtom parses a raw dependency string into its constituent parts.
type PackageData ¶ added in v0.0.19
type PackageData struct {
Name string
Category string
Versions []VersionData
Metadata *PkgMetadata
MetadataError error
Manifest *Manifest
Files []FileData
// Git info
MetadataRawURL string
// Lint Info
LintWarnings []string
}
type PackageDeprecated ¶ added in v0.0.20
type PackageDeprecated struct {
Package string
Reason string
Date string
Author string
AuthorEmail string
}
PackageDeprecated represents a single deprecation entry from profiles/package.deprecated.
func ParsePackageDeprecated ¶ added in v0.0.20
func ParsePackageDeprecated(path string) ([]PackageDeprecated, error)
func ParsePackageDeprecatedFS ¶ added in v0.0.20
func ParsePackageDeprecatedFS(sysFS fs.FS, path string) ([]PackageDeprecated, error)
type PackageMove ¶ added in v0.0.17
type PackageSlotMove ¶ added in v0.0.20
type PackageUpdate ¶ added in v0.0.17
type PackageUpdate struct {
Moves []PackageMove
SlotMoves []PackageSlotMove
}
func ParseUpdatesDir ¶ added in v0.0.17
func ParseUpdatesDir(dir string) (*PackageUpdate, error)
func ParseUpdatesDirFS ¶ added in v0.0.19
func ParseUpdatesDirFS(sysFS fs.FS, dir string) (*PackageUpdate, error)
type ParseError ¶ added in v0.0.19
func (*ParseError) Error ¶ added in v0.0.19
func (e *ParseError) Error() string
func (*ParseError) Unwrap ¶ added in v0.0.19
func (e *ParseError) Unwrap() error
type ParsedEbuild ¶ added in v0.0.35
type ParsedEbuild struct {
Variables map[string]string
Functions map[string]AST
Order []string
EbuildHeader string
}
ParsedEbuild contains the results of parsing an ebuild
type ParsingMode ¶
type ParsingMode uint
const ( ParseMetadataOnly ParsingMode = iota + 1 // Parse only filename-based metadata (PN, PV, etc.) ParseVariables // Parse variable definitions in the file ParseFull // Parse everything (e.g. SRC_URI) )
func (ParsingMode) String ¶
func (m ParsingMode) String() string
type Part ¶ added in v0.0.23
type Part string
Part represents a specific component of a Gentoo version.
type Pkg ¶
type Pkg struct {
// Text of the package.
Text string `xml:",innerxml"`
}
Pkg represents a cross-linking package. Note: This struct is not directly used in LongDescription to preserve mixed content via InnerXML, but is provided as part of the model definition.
type PkgDescIndex ¶ added in v0.0.19
type PkgDescIndex struct {
Entries []PkgDescIndexEntry
}
PkgDescIndex represents the parsed content of a pkg_desc_index file.
func ParsePkgDescIndex ¶ added in v0.0.19
func ParsePkgDescIndex(r io.Reader) (*PkgDescIndex, error)
ParsePkgDescIndex reads and parses the pkg_desc_index file from an io.Reader.
func ParsePkgDescIndexFile ¶ added in v0.0.19
func ParsePkgDescIndexFile(path string) (*PkgDescIndex, error)
ParsePkgDescIndexFile reads and parses a pkg_desc_index file from disk.
func (*PkgDescIndex) Save ¶ added in v0.0.19
func (idx *PkgDescIndex) Save(path string) error
Save serializes the PkgDescIndex and writes it to the specified file path.
func (*PkgDescIndex) Serialize ¶ added in v0.0.19
func (idx *PkgDescIndex) Serialize(w io.Writer) error
Serialize formats the PkgDescIndex into the expected text format.
func (*PkgDescIndex) Sort ¶ added in v0.0.19
func (idx *PkgDescIndex) Sort()
Sort sorts the entries alphabetically by category and package.
type PkgDescIndexEntry ¶ added in v0.0.19
type PkgDescIndexEntry struct {
Category string
Package string
Versions []string
Description string
}
PkgDescIndexEntry represents a single entry in the pkg_desc_index file.
type PkgMetadata ¶
type PkgMetadata struct {
XMLName xml.Name `xml:"pkgmetadata"`
Maintainers []Maintainer `xml:"maintainer"`
LongDescription []LongDescription `xml:"longdescription"`
Slots *Slots `xml:"slots"`
StabilizeAllArches *StabilizeAllArches `xml:"stabilize-allarches"`
Use []Use `xml:"use"`
Upstream *Upstream `xml:"upstream"`
}
func (*PkgMetadata) String ¶
func (p *PkgMetadata) String() string
type Projects ¶ added in v0.0.15
Projects represents a list of projects. Source: https://github.com/gentoo-mirror/gentoo/blob/stable/metadata/dtd/projects.dtd
func ParseProjects ¶ added in v0.0.15
ParseProjects parses a projects.xml file and returns a Projects pointer, or an error.
func ParseProjectsBytes ¶ added in v0.0.15
ParseProjectsBytes parses Projects from a byte slice.
type QAPolicy ¶ added in v0.0.19
func ParseQAPolicy ¶ added in v0.0.19
type Reader ¶ added in v0.0.19
type Reader struct {
Pos Position
// contains filtered or unexported fields
}
Wrapper for tracking position
func (*Reader) UnreadRune ¶ added in v0.0.19
type Realname ¶ added in v0.0.15
type Realname struct {
Fullname string `xml:"fullname,attr,omitempty"`
Firstname string `xml:"firstname"`
Familyname Familyname `xml:"familyname"`
}
type References ¶ added in v0.0.15
type References struct {
URIs []URI `xml:"uri"`
}
type RemoteID ¶
type RemoteID struct {
// Text of the remote identifier.
Text string `xml:",innerxml"`
// Type of the remote identifier.
Type string `xml:"type,attr"`
}
RemoteID represents a remote identifier for a package. Supported types: bitbucket, codeberg, cpan, cpan-module, cpe, cran, ctan, freedesktop-gitlab, gentoo, github, gitlab, gnome-gitlab, google-code, hackage, heptapod, kde-invent, launchpad, osdn, pear, pecl, pypi, rubygems, savannah, savannah-nongnu, sourceforge, sourcehut, vim
type Repositories ¶ added in v0.0.15
type Repositories struct {
XMLName xml.Name `xml:"repositories"`
Version string `xml:"version,attr"`
Repositories []Repository `xml:"repo"`
}
Repositories represents a list of Gentoo repositories. Source: https://github.com/gentoo-mirror/gentoo/blob/stable/metadata/dtd/repositories.dtd
func ParseRepositories ¶ added in v0.0.15
func ParseRepositories(path string) (*Repositories, error)
ParseRepositories parses a repositories.xml file and returns a Repositories pointer, or an error.
func ParseRepositoriesBytes ¶ added in v0.0.15
func ParseRepositoriesBytes(data []byte) (*Repositories, error)
ParseRepositoriesBytes parses Repositories from a byte slice.
func ParseRepositoriesFromReader ¶ added in v0.0.15
func ParseRepositoriesFromReader(r io.Reader) (*Repositories, error)
ParseRepositoriesFromReader parses Repositories from an io.Reader.
type Repository ¶ added in v0.0.15
type Repository struct {
Priority string `xml:"priority,attr,omitempty"`
Quality string `xml:"quality,attr"` // core|stable|testing|experimental|graveyard
Status string `xml:"status,attr"` // official|unofficial
Name string `xml:"name"`
Descriptions []RepositoryDescription `xml:"description"`
LongDescriptions []RepositoryDescription `xml:"longdescription"`
Homepage string `xml:"homepage,omitempty"`
Owners []RepositoryOwner `xml:"owner"`
Sources []RepositorySource `xml:"source"`
Feeds []string `xml:"feed"`
}
type RepositoryDescription ¶ added in v0.0.15
type RepositoryOwner ¶ added in v0.0.15
type RepositorySource ¶ added in v0.0.15
type RequiredUseAllOf ¶ added in v0.0.20
type RequiredUseAllOf struct {
Nodes []RequiredUseNode
}
RequiredUseAllOf represents a list of requirements, ALL of which must be met.
func (RequiredUseAllOf) Evaluate ¶ added in v0.0.20
func (a RequiredUseAllOf) Evaluate(context map[string]bool) bool
func (RequiredUseAllOf) String ¶ added in v0.0.20
func (a RequiredUseAllOf) String() string
type RequiredUseAnyOf ¶ added in v0.0.20
type RequiredUseAnyOf struct {
Nodes []RequiredUseNode
}
RequiredUseAnyOf represents a list of requirements, ANY of which must be met (||).
func (RequiredUseAnyOf) Evaluate ¶ added in v0.0.20
func (a RequiredUseAnyOf) Evaluate(context map[string]bool) bool
func (RequiredUseAnyOf) String ¶ added in v0.0.20
func (a RequiredUseAnyOf) String() string
type RequiredUseAtMostOneOf ¶ added in v0.0.20
type RequiredUseAtMostOneOf struct {
Nodes []RequiredUseNode
}
RequiredUseAtMostOneOf represents a list of requirements, AT MOST ONE of which must be met (??).
func (RequiredUseAtMostOneOf) Evaluate ¶ added in v0.0.20
func (a RequiredUseAtMostOneOf) Evaluate(context map[string]bool) bool
func (RequiredUseAtMostOneOf) String ¶ added in v0.0.20
func (a RequiredUseAtMostOneOf) String() string
type RequiredUseConditional ¶ added in v0.0.20
type RequiredUseConditional struct {
Condition string
Nodes RequiredUseAllOf
}
RequiredUseConditional represents a conditional requirement (flag? ( ... ) or !flag? ( ... )).
func (RequiredUseConditional) Evaluate ¶ added in v0.0.20
func (c RequiredUseConditional) Evaluate(context map[string]bool) bool
func (RequiredUseConditional) String ¶ added in v0.0.20
func (c RequiredUseConditional) String() string
type RequiredUseConfig ¶ added in v0.0.20
type RequiredUseConfig struct {
}
type RequiredUseExactlyOneOf ¶ added in v0.0.20
type RequiredUseExactlyOneOf struct {
Nodes []RequiredUseNode
}
RequiredUseExactlyOneOf represents a list of requirements, EXACTLY ONE of which must be met (^^).
func (RequiredUseExactlyOneOf) Evaluate ¶ added in v0.0.20
func (e RequiredUseExactlyOneOf) Evaluate(context map[string]bool) bool
func (RequiredUseExactlyOneOf) String ¶ added in v0.0.20
func (e RequiredUseExactlyOneOf) String() string
type RequiredUseFlag ¶ added in v0.0.20
type RequiredUseFlag struct {
Name string
}
RequiredUseFlag represents a single USE flag.
func (RequiredUseFlag) Evaluate ¶ added in v0.0.20
func (f RequiredUseFlag) Evaluate(context map[string]bool) bool
func (RequiredUseFlag) String ¶ added in v0.0.20
func (f RequiredUseFlag) String() string
type RequiredUseNode ¶ added in v0.0.20
RequiredUseNode represents a node in the REQUIRED_USE AST.
func ParseRequiredUse ¶ added in v0.0.20
func ParseRequiredUse(input string, opts ...any) (RequiredUseNode, error)
ParseRequiredUse parses a REQUIRED_USE string into an AST.
type RequiredUseOption ¶ added in v0.0.20
type RequiredUseOption interface {
Apply(*RequiredUseConfig)
}
type Resolution ¶ added in v0.0.15
type Resolution struct {
Text string `xml:",innerxml"`
}
type Slot ¶
type Slot struct {
// Name of the SLOT.
Name string `xml:"name,attr"`
// Text of the slot.
Text string `xml:",innerxml"`
}
Slot represents a particular SLOT.
type Slots ¶
type Slots struct {
// Slot elements.
Slot []Slot `xml:"slot"`
// Subslots of the package.
Subslots string `xml:"subslots,omitempty"`
// Lang specifies the language of the slots.
Lang string `xml:"lang,attr,omitempty"`
}
Slots represents the description of a package's SLOTs.
type StabilizeAllArches ¶ added in v0.0.20
type StabilizeAllArches struct {
Restrict string `xml:"restrict,attr,omitempty"`
}
PkgMetadata represents metadata for a package. Source: https://github.com/gentoo-mirror/gentoo/blob/stable/metadata/dtd/metadata.dtd
func (*StabilizeAllArches) MarshalXML ¶ added in v0.0.20
func (s *StabilizeAllArches) MarshalXML(e *xml.Encoder, start xml.StartElement) error
type Subproject ¶ added in v0.0.15
type Unaffected ¶ added in v0.0.15
type Upstream ¶
type Upstream struct {
// Maintainers of the upstream.
Maintainers []Maintainer `xml:"maintainer"`
// URL of the upstream changelog.
Changelog string `xml:"changelog,omitempty"`
// Documentation URL of the upstream.
Doc []Doc `xml:"doc"`
// URL or email address to report bugs.
BugsTo string `xml:"bugs-to,omitempty"`
// Remote identifiers for the package.
RemoteID []RemoteID `xml:"remote-id"`
}
Upstream represents upstream metadata information.
type Use ¶
type Use struct {
// Flags representing the USE flags.
Flags []Flag `xml:"flag"`
// Lang specifies the language of the USE description.
Lang string `xml:"lang,attr,omitempty"`
}
Use represents the description of USE flags for a package.
type UseDesc ¶ added in v0.0.19
func ParseUseDescFile ¶ added in v0.0.19
type UseLocalDesc ¶ added in v0.0.19
type UseLocalDesc struct {
Flags map[string]map[string]string // pkg -> flag -> desc
HeaderLines []string
}
func ParseUseLocalDesc ¶ added in v0.0.19
func ParseUseLocalDesc(r io.Reader) (*UseLocalDesc, error)
func ParseUseLocalDescFile ¶ added in v0.0.19
func ParseUseLocalDescFile(filename string) (*UseLocalDesc, error)
func (*UseLocalDesc) WriteFile ¶ added in v0.0.19
func (ud *UseLocalDesc) WriteFile(filename string) error
type User ¶ added in v0.0.15
type User struct {
Username string `xml:"username,attr"`
Realname Realname `xml:"realname"`
PGPKeys []string `xml:"pgpkey"`
Aliases []string `xml:"alias"`
Emails []string `xml:"email"`
Joined []string `xml:"joined"`
Retired []string `xml:"retired"`
Status string `xml:"status,omitempty"`
Roles string `xml:"roles,omitempty"`
Location *Location `xml:"location"`
}
type UserList ¶ added in v0.0.15
UserList represents a list of users. Source: https://github.com/gentoo-mirror/gentoo/blob/stable/metadata/dtd/userinfo.dtd
func ParseUserInfo ¶ added in v0.0.15
ParseUserInfo parses a userinfo.xml file and returns a UserList pointer, or an error.
func ParseUserInfoBytes ¶ added in v0.0.15
ParseUserInfoBytes parses UserList from a byte slice.
type VersionData ¶ added in v0.0.19
type VersionData struct {
Version string
Ebuild *Ebuild
// Git info
EbuildRawURL string
// Deprecation
Deprecated *PackageDeprecated
}
type Vulnerable ¶ added in v0.0.15
type Workaround ¶ added in v0.0.15
type Workaround struct {
Text string `xml:",innerxml"`
}
Source Files
¶
- authors.go
- categories.go
- ebuild.go
- ebuild_parser.go
- feeds.go
- glsa.go
- httputil.go
- info_pkgs.go
- info_vars.go
- layout_conf.go
- license_groups.go
- manifest.go
- manifestutil.go
- metadata.go
- mirrors.go
- news.go
- news_parser.go
- package_deprecated.go
- pkg_desc_index.go
- projects.go
- qa_policy.go
- repositories.go
- required_use.go
- site.go
- thirdpartymirrors.go
- updates.go
- use_desc.go
- use_local_desc.go
- userinfo.go