Documentation ¶
Overview ¶
Copyright (C) 2017-2021 Daniele Rondina <geaaru@sabayonlinux.org>
This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>.
Copyright (C) 2017-2021 Daniele Rondina <geaaru@sabayonlinux.org>
This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>.
Index ¶
- Constants
- type GentooPackage
- func (p *GentooPackage) Admit(i *GentooPackage) (bool, error)
- func (p *GentooPackage) Equal(i *GentooPackage) (bool, error)
- func (p *GentooPackage) GetP() string
- func (p *GentooPackage) GetPF() string
- func (p *GentooPackage) GetPN() string
- func (p *GentooPackage) GetPV() string
- func (p *GentooPackage) GetPVR() (ans string)
- func (p *GentooPackage) GetPackageName() (ans string)
- func (p *GentooPackage) GetPackageNameWithCond() (ans string)
- func (p *GentooPackage) GetPackageNameWithSlot() (ans string)
- func (p *GentooPackage) GreaterThan(i *GentooPackage) (bool, error)
- func (p *GentooPackage) GreaterThanOrEqual(i *GentooPackage) (bool, error)
- func (p *GentooPackage) LessThan(i *GentooPackage) (bool, error)
- func (p *GentooPackage) LessThanOrEqual(i *GentooPackage) (bool, error)
- func (p *GentooPackage) OfPackage(i *GentooPackage) (ans bool)
- func (p *GentooPackage) String() string
- type GentooPackageSorter
- type PackageCond
- type PortageContentElem
- type PortageMetaData
- func NewPortageMetaData(pkg *GentooPackage) *PortageMetaData
- func ParseMetadataCatDir(dir string, opts *PortageUseParseOpts) ([]*PortageMetaData, error)
- func ParseMetadataDir(dir string, opts *PortageUseParseOpts) ([]*PortageMetaData, error)
- func ParsePackageMetadataDir(dir string, opts *PortageUseParseOpts) (*PortageMetaData, error)
- type PortageUseParseOpts
Constants ¶
const ( PkgCondInvalid = 0 // > PkgCondGreater = 1 // >= PkgCondGreaterEqual = 2 // < PkgCondLess = 3 // <= PkgCondLessEqual = 4 // = PkgCondEqual = 5 // ! PkgCondNot = 6 // ~ PkgCondAnyRevision = 7 // =<pkg>* PkgCondMatchVersion = 8 // !< PkgCondNotLess = 9 // !> PkgCondNotGreater = 10 )
const ( RegexCatString = `(^[a-z]+[0-9]*[a-z]*[-]*[a-z]+[0-9]*[a-z]*|^virtual)` RegexPkgNameString = `([a-zA-Z]*[0-9a-zA-Z\.\-_]*[a-zA-Z0-9]+|[a-zA-Z\-]+[+]+[-]+[0-9a-zA-Z\.]*|[a-zA-Z\-]+[+]+)` )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type GentooPackage ¶
type GentooPackage struct { Name string `json:"name,omitempty"` Category string `json:"category,omitempty"` Version string `json:"version,omitempty"` VersionSuffix string `json:"version_suffix,omitempty"` VersionBuild string `json:"version_build,omitempty"` Slot string `json:"slot,omitempty"` Condition PackageCond Repository string `json:"repository,omitempty"` UseFlags []string `json:"use_flags,omitempty"` License string `json:"license,omitempty"` }
func ParsePackageStr ¶
func ParsePackageStr(pkg string) (*GentooPackage, error)
return category, package, version, slot, condition
func (*GentooPackage) Admit ¶
func (p *GentooPackage) Admit(i *GentooPackage) (bool, error)
func (*GentooPackage) Equal ¶ added in v0.8.1
func (p *GentooPackage) Equal(i *GentooPackage) (bool, error)
func (*GentooPackage) GetP ¶ added in v0.4.1
func (p *GentooPackage) GetP() string
func (*GentooPackage) GetPF ¶ added in v0.4.1
func (p *GentooPackage) GetPF() string
func (*GentooPackage) GetPN ¶ added in v0.4.1
func (p *GentooPackage) GetPN() string
func (*GentooPackage) GetPV ¶ added in v0.4.1
func (p *GentooPackage) GetPV() string
func (*GentooPackage) GetPVR ¶ added in v0.4.1
func (p *GentooPackage) GetPVR() (ans string)
func (*GentooPackage) GetPackageName ¶
func (p *GentooPackage) GetPackageName() (ans string)
func (*GentooPackage) GetPackageNameWithCond ¶ added in v0.8.1
func (p *GentooPackage) GetPackageNameWithCond() (ans string)
func (*GentooPackage) GetPackageNameWithSlot ¶ added in v0.8.1
func (p *GentooPackage) GetPackageNameWithSlot() (ans string)
func (*GentooPackage) GreaterThan ¶ added in v0.8.1
func (p *GentooPackage) GreaterThan(i *GentooPackage) (bool, error)
func (*GentooPackage) GreaterThanOrEqual ¶ added in v0.8.1
func (p *GentooPackage) GreaterThanOrEqual(i *GentooPackage) (bool, error)
func (*GentooPackage) LessThan ¶ added in v0.8.1
func (p *GentooPackage) LessThan(i *GentooPackage) (bool, error)
func (*GentooPackage) LessThanOrEqual ¶ added in v0.8.1
func (p *GentooPackage) LessThanOrEqual(i *GentooPackage) (bool, error)
func (*GentooPackage) OfPackage ¶
func (p *GentooPackage) OfPackage(i *GentooPackage) (ans bool)
func (*GentooPackage) String ¶
func (p *GentooPackage) String() string
type GentooPackageSorter ¶ added in v0.8.1
type GentooPackageSorter []GentooPackage
func (GentooPackageSorter) Len ¶ added in v0.8.1
func (p GentooPackageSorter) Len() int
func (GentooPackageSorter) Less ¶ added in v0.8.1
func (p GentooPackageSorter) Less(i, j int) bool
func (GentooPackageSorter) Swap ¶ added in v0.8.1
func (p GentooPackageSorter) Swap(i, j int)
type PackageCond ¶
type PackageCond int
Package condition
func (PackageCond) Int ¶ added in v0.5.0
func (p PackageCond) Int() (ans int)
func (PackageCond) String ¶ added in v0.5.0
func (p PackageCond) String() (ans string)
type PortageContentElem ¶ added in v0.10.0
type PortageContentElem struct { Type string `json:"type"` File string `json:"file"` Hash string `json:"hash,omitempty"` UnixTimestamp string `json:"timestamp,omitempty"` Link string `json:"link,omitempty"` }
func GetCONTENTS ¶ added in v0.10.0
func GetCONTENTS(file string) ([]PortageContentElem, error)
func (PortageContentElem) String ¶ added in v0.10.0
func (e PortageContentElem) String() string
type PortageMetaData ¶ added in v0.9.0
type PortageMetaData struct { *GentooPackage `json:"package,omitempty"` IUse []string `json:"iuse,omitempty"` IUseEffective []string `json:"iuse_effective,omitempty"` Use []string `json:"use,omitempty"` Eapi string `json:"eapi,omitempty"` CxxFlags string `json:"cxxflags,omitempty"` CFlags string `json:"cflags,omitempty"` LdFlags string `json:"ldflags,omitempty"` CHost string `json:"chost,omitempty"` BDEPEND string `json:"bdepend,omitempty"` RDEPEND string `json:"rdepend,omitempty"` DEPEND string `json:"depend,omitempty"` REQUIRES string `json:"requires,omitempty"` KEYWORDS string `json:"keywords,omitempty"` PROVIDES string `json:"provides,omitempty"` SIZE string `json:"size,omitempty"` BUILD_TIME string `json:"build_time,omitempty"` CBUILD string `json:"cbuild,omitempty"` COUNTER string `json:"counter,omitempty"` DEFINED_PHASES string `json:"defined_phases,omitempty"` DESCRIPTION string `json:"description,omitempty"` FEATURES string `json:"features,omitempty"` HOMEPAGE string `json:"homepage,omitempty"` INHERITED string `json:"inherited,omitempty"` NEEDED string `json:"needed,omitempty"` NEEDED_ELF2 string `json:"needed_elf2,omitempty"` PKGUSE string `json:"pkguse,omitempty"` RESTRICT string `json:"restrict,omitempty"` Ebuild string `json:"ebuild,omitempty"` CONTENTS []PortageContentElem `json:"content,omitempty"` }
func NewPortageMetaData ¶ added in v0.9.0
func NewPortageMetaData(pkg *GentooPackage) *PortageMetaData
func ParseMetadataCatDir ¶ added in v0.9.0
func ParseMetadataCatDir(dir string, opts *PortageUseParseOpts) ([]*PortageMetaData, error)
func ParseMetadataDir ¶ added in v0.9.0
func ParseMetadataDir(dir string, opts *PortageUseParseOpts) ([]*PortageMetaData, error)
func ParsePackageMetadataDir ¶ added in v0.9.0
func ParsePackageMetadataDir(dir string, opts *PortageUseParseOpts) (*PortageMetaData, error)
func (*PortageMetaData) WriteMetadata2Dir ¶ added in v0.10.0
func (m *PortageMetaData) WriteMetadata2Dir(dir string, opts *PortageUseParseOpts) error
type PortageUseParseOpts ¶ added in v0.9.0
type PortageUseParseOpts struct { UseFilters []string `json:"use_filters,omitempty" yaml:"use_filters,omitempty"` Categories []string `json:"categories,omitempty" yaml:"categories,omitempty"` Packages []string `json:"pkgs_filters,omitempty" yaml:"pkgs_filters,omitempty"` Verbose bool `json:"verbose,omitempty" yaml:"verbose,omitempty"` }
func (*PortageUseParseOpts) AddCategory ¶ added in v0.10.0
func (o *PortageUseParseOpts) AddCategory(cat string)
func (*PortageUseParseOpts) IsCatAdmit ¶ added in v0.9.0
func (o *PortageUseParseOpts) IsCatAdmit(cat string) bool
func (*PortageUseParseOpts) IsPkgAdmit ¶ added in v0.9.0
func (o *PortageUseParseOpts) IsPkgAdmit(pkg string) bool