specs

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Feb 19, 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/>.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SanitizeCategory

func SanitizeCategory(cat string, slot string) string

Types

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

	Replacements PortageConverterReplacements `json:"replacements,omitempty" yaml:"replacements,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 (*PortageConverterArtefact) GetBuildtimeReplacement

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

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) HasBuildtimeReplacement

func (s *PortageConverterArtefact) HasBuildtimeReplacement(pkg string) 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 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"`
}

func IncludeFromYaml

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

type PortageConverterPkg

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

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

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

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

	MapArtefacts             map[string]*PortageConverterArtefact       `json:"-" yaml:"-"`
	MapReplacementsRuntime   map[string]*PortageConverterReplacePackage `json:"-" yaml:"-"`
	MapReplacementsBuildtime map[string]*PortageConverterReplacePackage `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) 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) GetBuildtimeReplacement

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

func (*PortageConverterSpecs) GetRuntimeReplacement

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

func (*PortageConverterSpecs) HasBuildtimeReplacement

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

func (*PortageConverterSpecs) HasRuntimeReplacement

func (s *PortageConverterSpecs) HasRuntimeReplacement(pkg string) 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"`
}

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