specs

package
v0.5.1 Latest Latest
Warning

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

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

Documentation

Overview

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

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

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

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

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

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

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

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

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

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

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

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

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

Index

Constants

View Source
const (
	MARKDEVKIT_CONFIGNAME = "mark-devkit"
	MARKDEVKIT_ENV_PREFIX = "MARKDEVKIT"
	MARKDEVKIT_VERSION    = `0.5.1`
)
View Source
const (
	HookOuterPreSourcer = "outer-pre-sourcer"
	HookInnerChroot     = "inner-chroot"
	HookOuterChroot     = "outer-chroot"
	HookOuterPostChroot = "outer-post-chroot"
	HookOuterPreChroot  = "outer-pre-chroot"
	HookOuterPostOutput = "outer-post-output"
)
View Source
const (
	CacheDataVersion = "1.0.6"
)

Variables

This section is empty.

Functions

func GenDefault

func GenDefault(viper *v.Viper)

func SanitizeCategory added in v0.5.0

func SanitizeCategory(cat string, slot string) string

Types

type Bind

type Bind struct {
	Source string `yaml:"source,omitempty" json:"source,omitempty"`
	Target string `yaml:"target,omitempty" json:"target,omitempty"`
}

type EnvVar

type EnvVar struct {
	Key   string `yaml:"key" json:"key"`
	Value string `yaml:"value" json:"value"`
}

type Hook

type Hook struct {
	File        string   `yaml:"-" json:"-"`
	Name        string   `yaml:"name,omitempty" json:"name,omitempty"`
	Description string   `yaml:"description,omitempty" json:"description,omitempty"`
	Type        HookType `yaml:"type,omitempty" json:"type,omitempty"`
	Commands    []string `yaml:"commands,omitempty" json:"commands,omitempty"`
	Entrypoint  []string `yaml:"entrypoint,omitempty" json:"entrypoint,omitempty"`

	Binds []Bind `yaml:"chroot_binds,omitempty" json:"chroot_binds,omitempty"`
}

func NewHookFromYaml

func NewHookFromYaml(data []byte, file string) (*Hook, error)

func (*Hook) GetBinds

func (h *Hook) GetBinds() []Bind

func (*Hook) GetCommands

func (h *Hook) GetCommands() []string

func (*Hook) GetDescription

func (h *Hook) GetDescription() string

func (*Hook) GetEntrypoint

func (h *Hook) GetEntrypoint() []string

func (*Hook) GetFile

func (h *Hook) GetFile() string

func (*Hook) GetName

func (h *Hook) GetName() string

func (*Hook) GetType

func (h *Hook) GetType() HookType

type HookFile

type HookFile struct {
	File  string `yaml:"-" json:"-"`
	Hooks []Hook `yaml:"hooks,omitempty" json:"hooks,omitempty"`
}

func NewHookFileFromFile

func NewHookFileFromFile(file string, opts map[string]interface{}) (*HookFile, error)

func NewHookFileFromYaml

func NewHookFileFromYaml(data []byte, file string) (*HookFile, error)

func (*HookFile) GetFile

func (h *HookFile) GetFile() string

func (*HookFile) GetHooks

func (h *HookFile) GetHooks() *[]Hook

type HookType

type HookType string

type Job

type Job struct {
	Name   string    `yaml:"name" json:"name"`
	Source JobSource `yaml:"source,omitempty" json:"source,omitempty"`
	Output JobOutput `yaml:"output,omitempty" json:"omitempty,omitempty"`

	Options map[string]interface{} `yaml:"options,omitempty" json:"options,omitempty"`
	Envs    []*EnvVar              `yaml:"environments,omitempty" json:"environments,omitempty"`

	ChrootBinds []Bind `yaml:"chroot_binds,omitempty" json:"chroot_binds,omitempty"`

	WorkspaceDir string   `yaml:"workspacedir,omitempty" json:"workspacedir,omitempty"`
	HooksBasedir string   `yaml:"hooks_basedir,omitempty" json:"hooks_basedir,omitempty"`
	Hooks        []string `yaml:"hooks_files,omitempty" json:"hooks_files,omitempty"`
}

func (*Job) Render

func (j *Job) Render(specfile string) (*JobRendered, error)

type JobOutput

type JobOutput struct {
	Type string `yaml:"type,omitempty" json:"type,omitempty"`
	Name string `yaml:"name,omitempty" json:"name,omitempty"`
	Dir  string `yaml:"dir,omitempty" json:"dir,omitempty"`

	TarformersSpec *tarf_specs.SpecFile `yaml:"tarformers_specs,omitempty" json:"tarformers_specs,omitempty"`
}

type JobRendered

type JobRendered struct {
	*Job
	HookFile []*HookFile `yaml:"hooks,omitempty" json:"hooks,omitempty"`
}

func (*JobRendered) GetBindsMap

func (j *JobRendered) GetBindsMap() map[string]string

func (*JobRendered) GetOptionsEnvsMap

func (j *JobRendered) GetOptionsEnvsMap() map[string]string

func (*JobRendered) GetPostChrootHooks

func (j *JobRendered) GetPostChrootHooks() *[]*Hook

func (*JobRendered) GetPostOutputHooks added in v0.4.0

func (j *JobRendered) GetPostOutputHooks() *[]*Hook

func (*JobRendered) GetPreChrootHooks

func (j *JobRendered) GetPreChrootHooks() *[]*Hook

func (*JobRendered) GetPreSourcesHooks added in v0.3.0

func (j *JobRendered) GetPreSourcesHooks() *[]*Hook

func (*JobRendered) Json

func (j *JobRendered) Json() ([]byte, error)

func (*JobRendered) Yaml

func (j *JobRendered) Yaml() ([]byte, error)

type JobSource

type JobSource struct {
	Type   string `yaml:"type,omitempty" json:"type,omitempty"`
	Uri    string `yaml:"uri,omitempty" json:"uri,omitempty"`
	Path   string `yaml:"path,omitempty" json:"path,omitempty"`
	Target string `yaml:"target,omitempty" json:"target,omitempty"`

	// Anisie specific options
	AniseConfigPath   string   `yaml:"anise_config,omitempty" json:"anise_config,omitempty"`
	AniseRepositories []string `yaml:"anise_repos,omitempty" json:"anise_repos,omitempty"`
	AnisePackages     []string `yaml:"anise_packages,omitempty" json:"anise_packages,omitempty"`
}

type KitRelease added in v0.5.0

type KitRelease struct {
	Sources []*ReposcanKit   `yaml:"sources,omitempty" json:"sources,omitempty"`
	Target  KitReleaseTarget `yaml:"target,omitempty" json:"target,omitempty"`
	MainKit string           `yaml:"main_kit,omitempty" json:"main_kit,omitempty"`
}

func (*KitRelease) GetMainKit added in v0.5.0

func (r *KitRelease) GetMainKit() string

func (*KitRelease) GetTargetKit added in v0.5.0

func (r *KitRelease) GetTargetKit() (*ReposcanKit, error)

type KitReleaseSpec added in v0.5.0

type KitReleaseSpec struct {
	Release *KitRelease `yaml:"release,omitempty" json:"release,omitempty"`

	File string `yaml:"-" json:"-"`
}

func NewKitReleaseSpec added in v0.5.0

func NewKitReleaseSpec() *KitReleaseSpec

func (*KitReleaseSpec) GetSourceKit added in v0.5.0

func (r *KitReleaseSpec) GetSourceKit(name string) *ReposcanKit

func (*KitReleaseSpec) LoadFile added in v0.5.0

func (r *KitReleaseSpec) LoadFile(file string) error

func (*KitReleaseSpec) LoadYaml added in v0.5.0

func (r *KitReleaseSpec) LoadYaml(data []byte, file string) error

type KitReleaseTarget added in v0.5.0

type KitReleaseTarget struct {
	Name   string `yaml:"name" json:"name"`
	Url    string `yaml:"url,omitempty" json:"url,omitempty"`
	Branch string `yaml:"branch" json:"branch"`
}

type MarkDevkitConfig

type MarkDevkitConfig struct {
	Viper *v.Viper `yaml:"-" json:"-"`

	General MarkDevkitGeneral `mapstructure:"general" json:"general,omitempty" yaml:"general,omitempty"`
	Logging MarkDevkitLogging `mapstructure:"logging" json:"logging,omitempty" yaml:"logging,omitempty"`
}

func NewMarkDevkitConfig

func NewMarkDevkitConfig(viper *v.Viper) *MarkDevkitConfig

func (*MarkDevkitConfig) GetGeneral

func (c *MarkDevkitConfig) GetGeneral() *MarkDevkitGeneral

func (*MarkDevkitConfig) GetLogging

func (c *MarkDevkitConfig) GetLogging() *MarkDevkitLogging

func (*MarkDevkitConfig) Unmarshal

func (c *MarkDevkitConfig) Unmarshal() error

func (*MarkDevkitConfig) Yaml

func (c *MarkDevkitConfig) Yaml() ([]byte, error)

type MarkDevkitGeneral

type MarkDevkitGeneral struct {
	Debug bool `mapstructure:"debug,omitempty" json:"debug,omitempty" yaml:"debug,omitempty"`
}

func (*MarkDevkitGeneral) HasDebug

func (g *MarkDevkitGeneral) HasDebug() bool

type MarkDevkitLogging

type MarkDevkitLogging struct {
	// Path of the logfile
	Path string `mapstructure:"path,omitempty" json:"path,omitempty" yaml:"path,omitempty"`
	// Enable/Disable logging to file
	EnableLogFile bool `mapstructure:"enable_logfile,omitempty" json:"enable_logfile,omitempty" yaml:"enable_logfile,omitempty"`
	// Enable JSON format logging in file
	JsonFormat bool `mapstructure:"json_format,omitempty" json:"json_format,omitempty" yaml:"json_format,omitempty"`

	// Log level
	Level string `mapstructure:"level,omitempty" json:"level,omitempty" yaml:"level,omitempty"`

	// Enable emoji
	EnableEmoji bool `mapstructure:"enable_emoji,omitempty" json:"enable_emoji,omitempty" yaml:"enable_emoji,omitempty"`
	// Enable/Disable color in logging
	Color bool `mapstructure:"color,omitempty" json:"color,omitempty" yaml:"color,omitempty"`
}

type MergeKit added in v0.5.0

type MergeKit struct {
	Sources []*ReposcanKit `yaml:"sources,omitempty" json:"sources,omitempty"`
	Target  MergeKitTarget `yaml:"target,omitempty" json:"target,omitempty"`

	File string `yaml:"-" json:"-"`
}

func NewMergeKit added in v0.5.0

func NewMergeKit() *MergeKit

func (*MergeKit) GetEclassesInclude added in v0.5.0

func (m *MergeKit) GetEclassesInclude() *map[string][]string

func (*MergeKit) GetFixupsInclude added in v0.5.0

func (m *MergeKit) GetFixupsInclude() *[]*MergeKitFixupInclude

func (*MergeKit) GetMetadata added in v0.5.0

func (m *MergeKit) GetMetadata() *MergeKitMetadata

func (*MergeKit) GetSourceKit added in v0.5.0

func (m *MergeKit) GetSourceKit(name string) *ReposcanKit

func (*MergeKit) GetTargetKit added in v0.5.0

func (m *MergeKit) GetTargetKit() (*ReposcanKit, error)

func (*MergeKit) LoadFile added in v0.5.0

func (m *MergeKit) LoadFile(file string) error

func (*MergeKit) LoadYaml added in v0.5.0

func (m *MergeKit) LoadYaml(data []byte, file string) error

type MergeKitAtom added in v0.5.0

type MergeKitAtom struct {
	Package     string   `yaml:"pkg,omitempty" json:"pkg,omitempty"`
	MaxVersions *int     `yaml:"max_versions,omitempty" json:"max_versions,omitempty"`
	Conditions  []string `yaml:"conditions,omitempty" json:"conditions,omitempty"`
}

type MergeKitEclasses added in v0.5.0

type MergeKitEclasses struct {
	Include map[string][]string `yaml:"include,omitempty" json:"include,omitempty"`
}

type MergeKitFixupInclude added in v0.5.0

type MergeKitFixupInclude struct {
	Dir  string `yaml:"dir,omitempty" json:"dir,omitempty"`
	To   string `yaml:"to,omitempty" json:"to,omitempty"`
	File string `yaml:"file,omitempty" json:"file,omitempty"`
	Name string `yaml:"name,omitempty" json:"name,omitempty"`
}

type MergeKitFixups added in v0.5.0

type MergeKitFixups struct {
	Include []*MergeKitFixupInclude `yaml:"include,omitempty" json:"include,omitempty"`
}

type MergeKitMetadata added in v0.5.0

type MergeKitMetadata struct {
	LayoutMasters string   `yaml:"layout_masters,omitempty" json:"layout_masters,omitempty"`
	Aliases       []string `yaml:"aliases,omitempty" json:"aliases,omitempty"`
}

func (*MergeKitMetadata) GetLayoutMasters added in v0.5.0

func (m *MergeKitMetadata) GetLayoutMasters() string

func (*MergeKitMetadata) HasAliases added in v0.5.0

func (m *MergeKitMetadata) HasAliases() bool

type MergeKitTarget added in v0.5.0

type MergeKitTarget struct {
	Name   string `yaml:"name" json:"name"`
	Url    string `yaml:"url,omitempty" json:"url,omitempty"`
	Branch string `yaml:"branch" json:"branch"`

	Eclasses          *MergeKitEclasses           `yaml:"eclasses,omitempty" json:"eclasses,omitempty"`
	Metadata          *MergeKitMetadata           `yaml:"metadata,omitempty" json:"metadata,omitempty"`
	ThirdpartyMirrors []*MergeKitThirdPartyMirror `yaml:"thirdpartymirrors,omitempty" json:"thirdpartymirrors,omitempty"`
	Fixups            *MergeKitFixups             `yaml:"fixups,omitempty" json:"fixups,omitempty"`

	AtomDefaults *MergeKitAtom   `yaml:"atoms_defaults,omitempty" json:"atoms_defaults,omitempty"`
	Atoms        []*MergeKitAtom `yaml:"atoms,omitempty" json:"atoms,omitempty"`
}

type MergeKitThirdPartyMirror added in v0.5.0

type MergeKitThirdPartyMirror struct {
	Alias string   `yaml:"alias,omitempty" json:"alias,omitempty"`
	Uri   []string `yaml:"uri,omitempty" json:"uri,omitempty"`
}

type MetaKitInfo added in v0.5.0

type MetaKitInfo struct {
	KitOrder    []string                  `yaml:"kit_order,omitempty" json:"kit_order,omitempty"`
	KitSettings map[string]MetaKitSetting `yaml:"kit_settings,omitempty" json:"kit_settings,omitempty"`
	ReleaseDefs map[string][]string       `yaml:"release_defs,omitempty" json:"release_defs,omitempty"`
	ReleaseInfo *MetaReleaseInfo          `yaml:"release_info,omitempty" json:"release_info,omitempty"`
}

kit-info.json structure

func (*MetaKitInfo) Json added in v0.5.0

func (i *MetaKitInfo) Json() ([]byte, error)

type MetaKitSetting added in v0.5.0

type MetaKitSetting struct {
	Stability map[string]string `yaml:"stability,omitempty" json:"stability,omitempty"`
	Type      string            `yaml:"type,omitempty" json:"type,omitempty"`
}

type MetaKitSha1 added in v0.5.0

type MetaKitSha1 struct {
	Kits map[string]map[string]interface{} `yaml:"-,inline" json:"-,inline"`
}

kit-sha1.json structure

func (*MetaKitSha1) Json added in v0.5.0

func (i *MetaKitSha1) Json() ([]byte, error)

type MetaKitShaValue added in v0.5.0

type MetaKitShaValue struct {
	Sha1  string `yaml:"sha1,omitempty" json:"sha1,omitempty"`
	Depth *int   `yaml:"depth,omitempty" json:"depth,omitempty"`
}

Instead of directly define the sha1 of a branch is possible define the depth and the sha1 together. This struct is used as value of the MetaKitSha1 map interface.

type MetaReleaseInfo added in v0.5.0

type MetaReleaseInfo struct {
	Required []map[string]string `yaml:"required,omitempty" json:"required,omitempty"`
	Version  int                 `yaml:"version,omitempty" json:"version,omitempty"`
}

Used by kit-info.json and version.json

func (*MetaReleaseInfo) Json added in v0.5.0

func (r *MetaReleaseInfo) Json() ([]byte, error)

type MetroSpec

type MetroSpec struct {
	Version string `yaml:"version,omitempty" json:"version,omitempty"`
	Jobs    []Job  `yaml:"jobs,omitempty" json:"jobs,omitempty"`

	File string `yaml:"-" json:"-"`
}

func NewMetroSpec

func NewMetroSpec() *MetroSpec

func (*MetroSpec) GetJob

func (s *MetroSpec) GetJob(name string) *Job

func (*MetroSpec) LoadYaml

func (s *MetroSpec) LoadYaml(data []byte, file string) error

type RepoScanAtom added in v0.5.0

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.5.0

func (r *RepoScanAtom) AddRelations(pkgname string)

func (*RepoScanAtom) AddRelationsByKind added in v0.5.0

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

func (*RepoScanAtom) GetBuildtimeDeps added in v0.5.0

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

func (*RepoScanAtom) GetCategory added in v0.5.0

func (r *RepoScanAtom) GetCategory() string

func (*RepoScanAtom) GetMetadataValue added in v0.5.0

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

func (*RepoScanAtom) GetPackageName added in v0.5.0

func (r *RepoScanAtom) GetPackageName() string

func (*RepoScanAtom) GetRuntimeDeps added in v0.5.0

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

func (*RepoScanAtom) HasMetadataKey added in v0.5.0

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

func (*RepoScanAtom) Json added in v0.5.0

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

func (*RepoScanAtom) ToGentooPackage added in v0.5.0

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

func (*RepoScanAtom) Yaml added in v0.5.0

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

type RepoScanFile added in v0.5.0

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

type RepoScanSpec added in v0.5.0

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.5.0

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

func (*RepoScanSpec) WriteJsonFile added in v0.5.0

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

func (*RepoScanSpec) Yaml added in v0.5.0

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

type ReposcanAnalysis added in v0.5.0

type ReposcanAnalysis struct {
	Kits []*ReposcanKit `yaml:"kits,omitempty" json:"kits,omitempty"`
}

func NewReposcanAnalysis added in v0.5.0

func NewReposcanAnalysis(file string) (*ReposcanAnalysis, error)

func (*ReposcanAnalysis) Json added in v0.5.0

func (ra *ReposcanAnalysis) Json() ([]byte, error)

func (*ReposcanAnalysis) WriteYamlFile added in v0.5.0

func (ra *ReposcanAnalysis) WriteYamlFile(file string) error

func (*ReposcanAnalysis) Yaml added in v0.5.0

func (ra *ReposcanAnalysis) Yaml() ([]byte, error)

type ReposcanKit added in v0.5.0

type ReposcanKit struct {
	Name       string `yaml:"name,omitempty" json:"name,omitempty"`
	Url        string `yaml:"url,omitempty" json:"url,omitempty"`
	Branch     string `yaml:"branch,omitempty" json:"branch,omitempty"`
	CommitSha1 string `yaml:"commit_sha1,omitempty" json:"commit_sha1,omitempty"`
	Depth      *int   `yaml:"depth,omitempty" json:"depth,omitempty"`
	Priority   *int   `yaml:"priority,omitempty" json:"priority,omitempty"`
}

func NewReposcanKit added in v0.5.0

func NewReposcanKit(name, url, branch, commit string) *ReposcanKit

func (*ReposcanKit) GetPriority added in v0.5.0

func (r *ReposcanKit) GetPriority() int

Jump to

Keyboard shortcuts

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