specs

package
v0.16.2 Latest Latest
Warning

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

Go to latest
Published: Dec 24, 2024 License: GPL-3.0 Imports: 11 Imported by: 0

Documentation

Overview

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.

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.

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

This section is empty.

Variables

This section is empty.

Functions

func SanitizeCategory

func SanitizeCategory(cat string, slot string) string

Types

type Finalizer

type Finalizer struct {
	Shell     []string `json:"shell,omitempty" yaml:"shell,omitempty"`
	Install   []string `json:"install,omitempty" yaml:"install,omitempty"`
	Uninstall []string `json:"uninstall,omitempty" yaml:"uninstall,omitempty"`
}

func (*Finalizer) IsValid

func (f *Finalizer) IsValid() bool

func (*Finalizer) WriteFinalize

func (f *Finalizer) WriteFinalize(path string) error

func (*Finalizer) Yaml

func (f *Finalizer) Yaml() ([]byte, error)

type PortageConverterArtefact

type PortageConverterArtefact struct {
	Tree            string                   `json:"tree" yaml:"tree"`
	Uses            PortageConverterUseFlags `json:"uses,omitempty" yaml:"uses,omitempty"`
	IgnoreBuildDeps bool                     `json:"ignore_build_deps,omitempty" yaml:"ignore_build_deps,omitempty"`
	Packages        []string                 `json:"packages" yaml:"packages"`
	OverrideVersion string                   `json:"override_version,omitempty" yaml:"override_version,omitempty"`

	CustomPath string   `json:"custom_path,omitempty" yaml:"custom_path,omitempty"`
	Conditions []string `json:"conditions,omitempty" yaml:"conditions,omitempty"`

	Replacements PortageConverterReplacements `json:"replacements,omitempty" yaml:"replacements,omitempty"`
	Mutations    PortageConverterMutations    `json:"mutations,omitempty" yaml:"mutations,omitempty"`

	Finalize    Finalizer              `json:"finalizer,omitempty" yaml:"finalizer,omitempty"`
	Annotations map[string]interface{} `json:"annotations,omitempty" yaml:"annotations,omitempty"`

	MapReplacementsRuntime   map[string]*PortageConverterReplacePackage `json:"-" yaml:"-"`
	MapReplacementsBuildtime map[string]*PortageConverterReplacePackage `json:"-" yaml:"-"`
	MapIgnoreRuntime         map[string]bool                            `json:"-" yaml:"-"`
	MapIgnoreBuildtime       map[string]bool                            `json:"-" yaml:"-"`
}

func NewPortageConverterArtefact

func NewPortageConverterArtefact(pkg string) *PortageConverterArtefact

func (*PortageConverterArtefact) GetAnnotations

func (a *PortageConverterArtefact) GetAnnotations() map[string]interface{}

func (*PortageConverterArtefact) GetBuildtimeReplacement

func (s *PortageConverterArtefact) GetBuildtimeReplacement(pkg string) (*PortageConverterReplacePackage, error)

func (*PortageConverterArtefact) GetOverrideVersion

func (a *PortageConverterArtefact) GetOverrideVersion() string

func (*PortageConverterArtefact) GetPackages

func (a *PortageConverterArtefact) GetPackages() []string

func (*PortageConverterArtefact) GetRuntimeReplacement

func (s *PortageConverterArtefact) GetRuntimeReplacement(pkg string) (*PortageConverterReplacePackage, error)

func (*PortageConverterArtefact) GetTree

func (a *PortageConverterArtefact) GetTree() string

func (*PortageConverterArtefact) HasBuildtimeMutations

func (a *PortageConverterArtefact) HasBuildtimeMutations() bool

func (*PortageConverterArtefact) HasBuildtimeReplacement

func (s *PortageConverterArtefact) HasBuildtimeReplacement(pkg string) bool

func (*PortageConverterArtefact) HasConflict added in v0.15.0

func (*PortageConverterArtefact) HasOverrideVersion

func (a *PortageConverterArtefact) HasOverrideVersion(pkg string) bool

func (*PortageConverterArtefact) HasRuntimeMutations

func (a *PortageConverterArtefact) HasRuntimeMutations() bool

func (*PortageConverterArtefact) HasRuntimeReplacement

func (s *PortageConverterArtefact) HasRuntimeReplacement(pkg string) bool

func (*PortageConverterArtefact) IgnoreBuildtime

func (a *PortageConverterArtefact) IgnoreBuildtime(pkg string) bool

func (*PortageConverterArtefact) IgnoreRuntime

func (a *PortageConverterArtefact) IgnoreRuntime(pkg string) bool

type PortageConverterBuildLayer

type PortageConverterBuildLayer struct {
	Layer    PortageConverterPkg `json:"layer,omitempty" yaml:"layer,omitempty"`
	Packages []string            `json:"packages" yaml:"packages"`
}

func IncludeLayerFromYaml

func IncludeLayerFromYaml(data []byte) (*PortageConverterBuildLayer, error)

type PortageConverterDepReplacements

type PortageConverterDepReplacements struct {
	Packages []PortageConverterReplacePackage `json:"packages,omitempty" yaml:"packages,omitempty"`
	Ignore   []PortageConverterPkg            `json:"ignore,omitempty" yaml:"ignore,omitempty"`
}

type PortageConverterInclude

type PortageConverterInclude struct {
	SkippedResolutions PortageConverterSkips        `json:"skipped_resolutions,omitempty" yaml:"skipped_resolutions,omitempty"`
	Artefacts          []PortageConverterArtefact   `json:"artefacts,omitempty" yaml:"artefacts,omitempty"`
	BuildLayers        []PortageConverterBuildLayer `json:"build_layers,omitempty" yaml:"build_layers,omitempty"`
}

func IncludeFromYaml

func IncludeFromYaml(data []byte) (*PortageConverterInclude, error)

type PortageConverterMutationDeps

type PortageConverterMutationDeps struct {
	Packages []PortageConverterPkg `json:"packages,omitempty" yaml:"packages,omitempty"`
}

type PortageConverterMutations

type PortageConverterMutations struct {
	RuntimeDeps   PortageConverterMutationDeps `json:"runtime_deps,omitempty" yaml:"runtime_deps,omitempty"`
	BuildTimeDeps PortageConverterMutationDeps `json:"buildtime_deps,omitempty" yaml:"buildtime_deps,omitempty"`
	Uses          []string                     `json:"uses,omitempty" yaml:"uses,omitempty"`
	Provides      []PortageConverterPkg        `json:"provides,omitempty" yaml:"provides,omitempty"`
	Conflicts     []PortageConverterPkg        `json:"conflicts,omitempty" yaml:"conflicts,omitempty"`
}

type PortageConverterPkg

type PortageConverterPkg struct {
	Name     string `json:"name" yaml:"name"`
	Category string `json:"category" yaml:"category"`
	Version  string `json:"version" yaml:"version"`
}

func (*PortageConverterPkg) EqualTo

func (p *PortageConverterPkg) EqualTo(pkg *gentoo.GentooPackage) (bool, error)

func (*PortageConverterPkg) GetPackageName

func (p *PortageConverterPkg) GetPackageName() string

type PortageConverterReplacePackage

type PortageConverterReplacePackage struct {
	From PortageConverterPkg `json:"from" yaml:"from"`
	To   PortageConverterPkg `json:"to" yaml:"to"`
}

type PortageConverterReplacements

type PortageConverterReplacements struct {
	RuntimeDeps  PortageConverterDepReplacements `json:"runtime_deps,omitempty" yaml:"runtime_deps,omitempty"`
	BuiltimeDeps PortageConverterDepReplacements `json:"buildtime_deps,omitempty" yaml:"buildtime_deps,omitempty"`
}

type PortageConverterReposcanConstraints

type PortageConverterReposcanConstraints struct {
	Packages []string `json:"packages,omitempty" yaml:"packages,omitempty"`
}

type PortageConverterSkips

type PortageConverterSkips struct {
	Packages        []PortageConverterPkg `json:"packages,omitempty" yaml:"packages,omitempty"`
	Categories      []string              `json:"categories,omitempty" yaml:"categories,omitempty"`
	BuildCategories []string              `json:"build_categories,omitempty" yaml:"build_categories,omitempty"`
}

type PortageConverterSpecs

type PortageConverterSpecs struct {
	File string `json:"-" yaml:"-"`

	SkippedResolutions PortageConverterSkips `json:"skipped_resolutions,omitempty" yaml:"skipped_resolutions,omitempty"`

	TreePaths []string `json:"trees,omitempty" yaml:"trees,omitempty"`

	IncludeFiles         []string                   `json:"include_files,omitempty" yaml:"include_files,omitempty"`
	Artefacts            []PortageConverterArtefact `json:"artefacts,omitempty" yaml:"artefacts,omitempty"`
	BuildTmplFile        string                     `json:"build_template_file" yaml:"build_template_file"`
	BuildPortageTmplFile string                     `json:"build_portage_template_file,omitempty" yaml:"build_portage_template_file,omitempty"`

	// Reposcan options
	ReposcanRequiresWithSlot  bool                                `json:"reposcan_requires_slot,omitempty" yaml:"reposcan_requires_slot,omitempty"`
	ReposcanAllowEmpyKeywords bool                                `json:"reposcan_allow_empty_keywords,omitempty" yaml:"reposcan_allow_empty_keywords,omitempty"`
	ReposcanSources           []string                            `json:"reposcan_sources,omitempty" yaml:"reposcan_sources,omitempty"`
	ReposcanConstraints       PortageConverterReposcanConstraints `json:"reposcan_contraints,omitempty" yaml:"reposcan_contraints,omitempty"`
	ReposcanDisabledUseFlags  []string                            `json:"reposcan_disabled_use_flags,omitempty" yaml:"reposcan_disabled_use_flags,omitempty"`
	ReposcanDisabledKeywords  []string                            `json:"reposcan_disabled_keywords,omitempty" yaml:"reposcan_disabled_keywords,omitempty"`

	Replacements PortageConverterReplacements `json:"replacements,omitempty" yaml:"replacements,omitempty"`

	BuildLayers   []PortageConverterBuildLayer `json:"build_layers,omitempty" yaml:"build_layers,omitempty"`
	IncludeLayers []string                     `json:"include_layers,omitempty" yaml:"include_layers,omitempty"`

	Annotations map[string]interface{} `json:"global_annotations,omitempty" yaml:"global_annotations,omitempty"`

	MapArtefacts             map[string]*PortageConverterArtefact       `json:"-" yaml:"-"`
	MapReplacementsRuntime   map[string]*PortageConverterReplacePackage `json:"-" yaml:"-"`
	MapReplacementsBuildtime map[string]*PortageConverterReplacePackage `json:"-" yaml:"-"`
	MapBuildLayer            map[string]*PortageConverterBuildLayer     `json:"-" yaml:"-"`
}

func LoadSpecsFile

func LoadSpecsFile(file string) (*PortageConverterSpecs, error)

func SpecsFromYaml

func SpecsFromYaml(data []byte) (*PortageConverterSpecs, error)

func (*PortageConverterSpecs) AddReposcanDisabledUseFlags

func (s *PortageConverterSpecs) AddReposcanDisabledUseFlags(uses []string)

func (*PortageConverterSpecs) AddReposcanSource

func (s *PortageConverterSpecs) AddReposcanSource(source string)

func (*PortageConverterSpecs) GenerateArtefactsMap

func (s *PortageConverterSpecs) GenerateArtefactsMap()

func (*PortageConverterSpecs) GenerateBuildLayerMap

func (s *PortageConverterSpecs) GenerateBuildLayerMap()

func (*PortageConverterSpecs) GenerateReplacementsMap

func (s *PortageConverterSpecs) GenerateReplacementsMap()

func (*PortageConverterSpecs) GetArtefactByPackage

func (s *PortageConverterSpecs) GetArtefactByPackage(pkg string) (*PortageConverterArtefact, error)

func (*PortageConverterSpecs) GetArtefacts

func (s *PortageConverterSpecs) GetArtefacts() []PortageConverterArtefact

func (*PortageConverterSpecs) GetBuildLayer

func (*PortageConverterSpecs) GetBuildtimeReplacement

func (s *PortageConverterSpecs) GetBuildtimeReplacement(pkg string) (*PortageConverterReplacePackage, error)

func (*PortageConverterSpecs) GetGlobalAnnotations

func (s *PortageConverterSpecs) GetGlobalAnnotations() *map[string]interface{}

func (*PortageConverterSpecs) GetRuntimeReplacement

func (s *PortageConverterSpecs) GetRuntimeReplacement(pkg string) (*PortageConverterReplacePackage, error)

func (*PortageConverterSpecs) HasBuildLayer

func (s *PortageConverterSpecs) HasBuildLayer(pkg string) bool

func (*PortageConverterSpecs) HasBuildtimeReplacement

func (s *PortageConverterSpecs) HasBuildtimeReplacement(pkg string) bool

func (*PortageConverterSpecs) HasRuntimeReplacement

func (s *PortageConverterSpecs) HasRuntimeReplacement(pkg string) bool

func (*PortageConverterSpecs) PackageIsALayer

func (s *PortageConverterSpecs) PackageIsALayer(pkg *gentoo.GentooPackage) bool

type PortageConverterUseFlags

type PortageConverterUseFlags struct {
	Disabled []string `json:"disabled,omitempty" yaml:"disabled,omitempty"`
	Enabled  []string `json:"enabled,omitempty" yaml:"enabled,omitempty"`
}

type PortageResolver

type PortageResolver interface {
	Resolve(pkg string, opts *PortageResolverOpts) (*PortageSolution, error)
}

type PortageResolverOpts

type PortageResolverOpts struct {
	EnableUseFlags   []string
	DisabledUseFlags []string
	Conditions       []string
}

func NewPortageResolverOpts

func NewPortageResolverOpts() *PortageResolverOpts

func (*PortageResolverOpts) IsAdmitUseFlag

func (o *PortageResolverOpts) IsAdmitUseFlag(u string) bool

type PortageSolution

type PortageSolution struct {
	Package          gentoo.GentooPackage   `json:"package"`
	PackageDir       string                 `json:"package_dir"`
	BuildDeps        []gentoo.GentooPackage `json:"build-deps,omitempty"`
	RuntimeDeps      []gentoo.GentooPackage `json:"runtime-deps,omitempty"`
	RuntimeConflicts []gentoo.GentooPackage `json:"runtime-conflicts,omitempty"`
	BuildConflicts   []gentoo.GentooPackage `json:"build-conflicts,omitempty"`

	Description string                 `json:"description,omitempty"`
	Uri         []string               `json:"uri,omitempty"`
	Labels      map[string]string      `json:"labels,omitempty"`
	Annotations map[string]interface{} `json:"annotations,omitempty" yaml:"annotations,omitempty"`

	OverrideVersion string                   `json:"override_version,omitempty"`
	Upgrade         bool                     `json:"upgrade,omitempty"`
	PackageUpgraded *luet_pkg.DefaultPackage `json:"-",omitempty"`
}

func (*PortageSolution) SetLabel

func (s *PortageSolution) SetLabel(k, v string)

func (*PortageSolution) String

func (s *PortageSolution) String() string

func (*PortageSolution) ToPack

func (s *PortageSolution) ToPack(runtime bool) *luet_pkg.DefaultPackage

Jump to

Keyboard shortcuts

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