reposcan

package
v0.16.3 Latest Latest
Warning

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

Go to latest
Published: Jan 1, 2025 License: GPL-3.0 Imports: 20 Imported by: 0

Documentation

Overview

Copyright © 2021-2023 Macaroni OS Linux See AUTHORS and LICENSE for the license details and contributors.

Copyright © 2021-2024 Macaroni OS Linux See AUTHORS and LICENSE for the license details and contributors.

Copyright © 2021-2024 Macaroni OS Linux See AUTHORS and LICENSE for the license details and contributors.

Copyright © 2021-2023 Macaroni OS Linux See AUTHORS and LICENSE for the license details and contributors.

Copyright © 2021-2023 Macaroni OS Linux See AUTHORS and LICENSE for the license details and contributors.

Index

Constants

View Source
const (
	CacheDataVersion = "1.0.6"
)

Variables

View Source
var (
	MetadataLines = []string{
		"DEPEND",
		"RDEPEND",
		"SLOT",
		"SRC_URI",
		"RESTRICT",
		"HOMEPAGE",
		"LICENSE",
		"DESCRIPTION",
		"KEYWORDS",
		"INHERITED",
		"IUSE",
		"REQUIRED_USE",
		"PDEPEND",
		"BDEPEND",
		"EAPI",
		"PROPERTIES",
		"DEFINED_PHASES",
		"HDEPEND",
		"PYTHON_COMPAT",
	}
)

Functions

This section is empty.

Types

type ChannelGenerateRes added in v0.16.0

type ChannelGenerateRes struct {
	Pkgdir string
	Error  error
}

type EbuildDependencies

type EbuildDependencies struct {
	Dependencies []*GentooDependency
}

func ParseDependencies

func ParseDependencies(rdepend string) (*EbuildDependencies, error)

func ParseDependenciesMultiline

func ParseDependenciesMultiline(rdepend string) (*EbuildDependencies, error)

func (*EbuildDependencies) GetDependencies

func (r *EbuildDependencies) GetDependencies() []*GentooDependency

func (*EbuildDependencies) GetUseFlags

func (r *EbuildDependencies) GetUseFlags() []string

type GentooDependency

type GentooDependency struct {
	Use          string
	UseCondition _gentoo.PackageCond
	SubDeps      []*GentooDependency
	Dep          *_gentoo.GentooPackage
	DepInOr      bool
}

func NewGentooDependency

func NewGentooDependency(pkg, use string) (*GentooDependency, error)

func NewGentooDependencyWithSubdeps

func NewGentooDependencyWithSubdeps(pkg, use string, subdeps []*GentooDependency) (*GentooDependency, error)

func (*GentooDependency) AddSubDependency

func (d *GentooDependency) AddSubDependency(pkg, use string) (*GentooDependency, error)

func (*GentooDependency) GetDepsList

func (d *GentooDependency) GetDepsList() []*GentooDependency

func (*GentooDependency) GetUseFlags

func (d *GentooDependency) GetUseFlags() []string

func (*GentooDependency) String

func (d *GentooDependency) String() string

type ManifestFile added in v0.16.0

type ManifestFile struct {
	Md5   string         `json:"manifest_md5,omitempty" yaml:"manifest_md5,omitempty"`
	Files []RepoScanFile `json:"files,omitempty" yaml:"files,omitempty"`
}

func NewManifestFile added in v0.16.3

func NewManifestFile(files []RepoScanFile) *ManifestFile

func ParseManifest added in v0.16.0

func ParseManifest(f string) (*ManifestFile, error)

func ParseManifestContent added in v0.16.3

func ParseManifestContent(content []byte) *ManifestFile

func (*ManifestFile) AddFiles added in v0.16.3

func (m *ManifestFile) AddFiles(files []RepoScanFile)

func (*ManifestFile) GetFiles added in v0.16.0

func (m *ManifestFile) GetFiles(srcUri string) ([]RepoScanFile, error)

func (*ManifestFile) Write added in v0.16.3

func (m *ManifestFile) Write(f string) error

type RepoScanAtom

type RepoScanAtom struct {
	Atom string `json:"atom,omitempty" yaml:"atom,omitempty"`

	Category string     `json:"category,omitempty" yaml:"category,omitempty"`
	Package  string     `json:"package,omitempty" yaml:"package,omitempty"`
	Revision string     `json:"revision,omitempty" yaml:"revision,omitempty"`
	CatPkg   string     `json:"catpkg,omitempty" yaml:"catpkg,omitempty"`
	Eclasses [][]string `json:"eclasses,omitempty" yaml:"eclasses,omitempty"`

	Kit    string `json:"kit,omitempty" yaml:"kit,omitempty"`
	Branch string `json:"branch,omitempty" yaml:"branch,omitempty"`

	// Relations contains the list of the keys defined on
	// relations_by_kind. The values could be RDEPEND, DEPEND, BDEPEND
	Relations       []string            `json:"relations,omitempty" yaml:"relations,omitempty"`
	RelationsByKind map[string][]string `json:"relations_by_kind,omitempty" yaml:"relations_by_kind,omitempty"`

	// Metadata contains ebuild variables.
	// Ex: SLOT, SRC_URI, HOMEPAGE, etc.
	Metadata    map[string]string `json:"metadata,omitempty" yaml:"metadata,omitempty"`
	MetadataOut string            `json:"metadata_out,omitempty" yaml:"metadata_out,omitempty"`

	ManifestMd5 string `json:"manifest_md5,omitempty" yaml:"manifest_md5,omitempty"`
	Md5         string `json:"md5,omitempty" yaml:"md5,omitempty"`

	// Fields present on failure
	Status string `json:"status,omitempty" yaml:"status,omitempty"`
	Output string `json:"output,omitempty" yaml:"output,omitempty"`

	Files []RepoScanFile `json:"files,omitempty" yaml:"files,omitempty"`
}

func (*RepoScanAtom) AddRelations added in v0.16.0

func (r *RepoScanAtom) AddRelations(pkgname string)

func (*RepoScanAtom) AddRelationsByKind added in v0.16.0

func (r *RepoScanAtom) AddRelationsByKind(kind, pkgname string)

func (*RepoScanAtom) GetBuildtimeDeps

func (r *RepoScanAtom) GetBuildtimeDeps() ([]gentoo.GentooPackage, error)

func (*RepoScanAtom) GetCategory

func (r *RepoScanAtom) GetCategory() string

func (*RepoScanAtom) GetMetadataValue

func (r *RepoScanAtom) GetMetadataValue(k string) string

func (*RepoScanAtom) GetPackageName

func (r *RepoScanAtom) GetPackageName() string

func (*RepoScanAtom) GetRuntimeDeps

func (r *RepoScanAtom) GetRuntimeDeps() ([]gentoo.GentooPackage, error)

func (*RepoScanAtom) HasMetadataKey

func (r *RepoScanAtom) HasMetadataKey(k string) bool

func (*RepoScanAtom) Json added in v0.16.0

func (r *RepoScanAtom) Json() (string, error)

func (*RepoScanAtom) ToGentooPackage

func (r *RepoScanAtom) ToGentooPackage() (*gentoo.GentooPackage, error)

func (*RepoScanAtom) Yaml added in v0.16.0

func (r *RepoScanAtom) Yaml() (string, error)

type RepoScanFile

type RepoScanFile struct {
	SrcUri []string          `json:"src_uri"`
	Size   string            `json:"size"`
	Hashes map[string]string `json:"hashes"`
	Name   string            `json:"name"`
}

type RepoScanGenerator added in v0.16.0

type RepoScanGenerator struct {
	PortageBinPath string `json:"portage_bin_path,omitempty" yaml:"portage_bin_path,omitempty"`

	EclassesPaths        []string `json:"eclass_paths,omitempty" yaml:"eclass_paths,omitempty"`
	PythonImplementation []string `json:"python_implementations,omitempty" yaml:"python_implementations,omitempty"`

	Counter int `json:"counter" yaml:"counter"`
	Errors  int `json:"errors" yaml:"errors"`

	Concurrency int `json:"-" yaml:"-"`

	EclassesHashMap map[string]string `json:"-" yaml:"-"`
	// contains filtered or unexported fields
}

NOTE: RepoScanGenerator is intended to parse

at max one kit for structure. You nee

func NewRepoScanGenerator added in v0.16.0

func NewRepoScanGenerator(portage_bpath string) *RepoScanGenerator

func (*RepoScanGenerator) AddEclassesPath added in v0.16.0

func (r *RepoScanGenerator) AddEclassesPath(p string)

func (*RepoScanGenerator) GetConcurrency added in v0.16.0

func (r *RepoScanGenerator) GetConcurrency() int

func (*RepoScanGenerator) GetEbuildMetadata added in v0.16.0

func (r *RepoScanGenerator) GetEbuildMetadata(
	file string, manifest *ManifestFile) (map[string]string, error)

func (*RepoScanGenerator) GetEclassHash added in v0.16.0

func (r *RepoScanGenerator) GetEclassHash(fpath string) string

func (*RepoScanGenerator) ParseAtom added in v0.16.0

func (r *RepoScanGenerator) ParseAtom(ebuildFile, cat, pkg, kit, branch string) (*RepoScanAtom, error)

func (*RepoScanGenerator) ProcessKit added in v0.16.0

func (r *RepoScanGenerator) ProcessKit(kit, branch, path string) (*RepoScanSpec, error)

func (*RepoScanGenerator) SetConcurrency added in v0.16.0

func (r *RepoScanGenerator) SetConcurrency(c int)

func (*RepoScanGenerator) SetEclassHash added in v0.16.0

func (r *RepoScanGenerator) SetEclassHash(fpath, hash string)

type RepoScanResolver

type RepoScanResolver struct {
	JsonSources        []string
	Sources            []RepoScanSpec
	Constraints        []string
	MapConstraints     map[string]([]gentoo.GentooPackage)
	Map                map[string]([]RepoScanAtom)
	IgnoreMissingDeps  bool
	ContinueWithError  bool
	DepsWithSlot       bool
	AllowEmptyKeywords bool
	DisabledUseFlags   []string
	DisabledKeywords   []string
}

func NewRepoScanResolver

func NewRepoScanResolver() *RepoScanResolver

func (*RepoScanResolver) BuildMap

func (r *RepoScanResolver) BuildMap() error

func (*RepoScanResolver) GetAllowEmptyKeywords added in v0.16.0

func (r *RepoScanResolver) GetAllowEmptyKeywords() bool

func (*RepoScanResolver) GetContinueWithError

func (r *RepoScanResolver) GetContinueWithError() bool

func (*RepoScanResolver) GetDepsWithSlot

func (r *RepoScanResolver) GetDepsWithSlot() bool

func (*RepoScanResolver) GetDisabledKeywords

func (r *RepoScanResolver) GetDisabledKeywords() []string

func (*RepoScanResolver) GetDisabledUseFlags

func (r *RepoScanResolver) GetDisabledUseFlags() []string

func (*RepoScanResolver) GetLastPackage

func (r *RepoScanResolver) GetLastPackage(pkg string, opts *specs.PortageResolverOpts) (*RepoScanAtom, error)

func (*RepoScanResolver) GetMap

func (r *RepoScanResolver) GetMap() map[string]([]RepoScanAtom)

func (*RepoScanResolver) IsDisableUseFlag

func (r *RepoScanResolver) IsDisableUseFlag(u string) bool

func (*RepoScanResolver) IsIgnoreMissingDeps

func (r *RepoScanResolver) IsIgnoreMissingDeps() bool

func (*RepoScanResolver) IsPresentPackage

func (r *RepoScanResolver) IsPresentPackage(pkg string) bool

func (*RepoScanResolver) KeywordsIsAdmit

func (r *RepoScanResolver) KeywordsIsAdmit(atom *RepoScanAtom, p *gentoo.GentooPackage) (bool, error)

func (*RepoScanResolver) LoadJson

func (r *RepoScanResolver) LoadJson(path string) error

func (*RepoScanResolver) LoadJsonFiles

func (r *RepoScanResolver) LoadJsonFiles(verbose bool) error

func (*RepoScanResolver) LoadRawJson

func (r *RepoScanResolver) LoadRawJson(raw, file string) error

func (*RepoScanResolver) PackageIsAdmit

func (r *RepoScanResolver) PackageIsAdmit(target, atom *gentoo.GentooPackage,
	opts *specs.PortageResolverOpts) (bool, error)

func (*RepoScanResolver) Resolve

func (*RepoScanResolver) SetAllowEmptyKeywords added in v0.16.0

func (r *RepoScanResolver) SetAllowEmptyKeywords(v bool)

func (*RepoScanResolver) SetContinueWithError

func (r *RepoScanResolver) SetContinueWithError(v bool)

func (*RepoScanResolver) SetDepsWithSlot

func (r *RepoScanResolver) SetDepsWithSlot(v bool)

func (*RepoScanResolver) SetDisabledKeywords

func (r *RepoScanResolver) SetDisabledKeywords(k []string)

func (*RepoScanResolver) SetDisabledUseFlags

func (r *RepoScanResolver) SetDisabledUseFlags(u []string)

func (*RepoScanResolver) SetIgnoreMissingDeps

func (r *RepoScanResolver) SetIgnoreMissingDeps(v bool)

type RepoScanSpec

type RepoScanSpec struct {
	CacheDataVersion string                  `json:"cache_data_version" yaml:"cache_data_version"`
	Atoms            map[string]RepoScanAtom `json:"atoms" yaml:"atoms"`
	MetadataErrors   map[string]RepoScanAtom `json:"metadata_errors,omitempty" yaml:"metadata_errors,omitempty"`

	File string `json:"-"`
}

func (*RepoScanSpec) Json added in v0.16.0

func (r *RepoScanSpec) Json() (string, error)

func (*RepoScanSpec) WriteJsonFile added in v0.16.0

func (r *RepoScanSpec) WriteJsonFile(f string) error

func (*RepoScanSpec) Yaml

func (r *RepoScanSpec) Yaml() (string, error)

Jump to

Keyboard shortcuts

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