specs

package
v0.4.4 Latest Latest
Warning

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

Go to latest
Published: Oct 9, 2021 License: GPL-3.0 Imports: 11 Imported by: 0

Documentation

Overview

Copyright (C) 2020-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) 2020-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) 2020-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) 2020-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) 2020-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) 2020-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

This section is empty.

Variables

This section is empty.

Functions

func SanitizeCategory

func SanitizeCategory(cat string, slot string) string

Types

type Finalizer added in v0.4.3

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

func (*Finalizer) IsValid added in v0.4.3

func (f *Finalizer) IsValid() bool

func (*Finalizer) WriteFinalize added in v0.4.3

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

func (*Finalizer) Yaml added in v0.4.3

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"`

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

	Finalize Finalizer `json:"finalizer,omitempty" yaml:"finalizer,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 added in v0.4.2

func NewPortageConverterArtefact(pkg string) *PortageConverterArtefact

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) 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 added in v0.4.2

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

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"`
}

type PortageConverterPkg

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

func (*PortageConverterPkg) EqualTo added in v0.4.2

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

func (*PortageConverterPkg) GetPackageName added in v0.4.2

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 {
	SkippedResolutions PortageConverterSkips `json:"skipped_resolutions,omitempty" yaml:"skipped_resolutions,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"`
	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"`

	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 added in v0.4.2

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 added in v0.4.2

func (*PortageConverterSpecs) GetBuildtimeReplacement

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

func (*PortageConverterSpecs) GetRuntimeReplacement

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

func (*PortageConverterSpecs) HasBuildLayer added in v0.4.2

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 added in v0.4.2

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
}

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"`

	OverrideVersion string `json:"override_version,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