rpmmd

package
v0.79.0 Latest Latest
Warning

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

Go to latest
Published: Aug 21, 2024 License: Apache-2.0 Imports: 8 Imported by: 18

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetVerStrFromPackageSpecList

func GetVerStrFromPackageSpecList(pkgs []PackageSpec, packageName string) (string, error)

func GetVerStrFromPackageSpecListPanic

func GetVerStrFromPackageSpecListPanic(pkgs []PackageSpec, packageName string) string

func LoadRepositoriesFromFile added in v0.33.0

func LoadRepositoriesFromFile(filename string) (map[string][]RepoConfig, error)

Types

type DistrosRepoConfigs

type DistrosRepoConfigs map[string]map[string][]RepoConfig

type Package

type Package struct {
	Name        string
	Summary     string
	Description string
	URL         string
	Epoch       uint
	Version     string
	Release     string
	Arch        string
	BuildTime   time.Time
	License     string
}

func (Package) ToPackageBuild

func (pkg Package) ToPackageBuild() PackageBuild

func (Package) ToPackageInfo

func (pkg Package) ToPackageInfo() PackageInfo

type PackageBuild

type PackageBuild struct {
	Arch           string        `json:"arch"`
	BuildTime      string        `json:"build_time"`
	Epoch          uint          `json:"epoch"`
	Release        string        `json:"release"`
	Source         PackageSource `json:"source"`
	Changelog      string        `json:"changelog"`
	BuildConfigRef string        `json:"build_config_ref"`
	BuildEnvRef    string        `json:"build_env_ref"`
	Metadata       struct{}      `json:"metadata"` // it's just an empty struct in lorax-composer
}

type PackageInfo

type PackageInfo struct {
	Name         string         `json:"name"`
	Summary      string         `json:"summary"`
	Description  string         `json:"description"`
	Homepage     string         `json:"homepage"`
	UpstreamVCS  string         `json:"upstream_vcs"`
	Builds       []PackageBuild `json:"builds"`
	Dependencies []PackageSpec  `json:"dependencies,omitempty"`
}

type PackageList

type PackageList []Package

func (PackageList) Search

func (packages PackageList) Search(globPatterns ...string) (PackageList, error)

func (PackageList) ToPackageInfos

func (packages PackageList) ToPackageInfos() []PackageInfo

type PackageSet

type PackageSet struct {
	Include         []string
	Exclude         []string
	Repositories    []RepoConfig
	InstallWeakDeps bool
}

The inputs to depsolve, a set of packages to include and a set of packages to exclude. The Repositories are used when depsolving this package set in addition to the base repositories.

func (PackageSet) Append

func (ps PackageSet) Append(other PackageSet) PackageSet

Append the Include and Exclude package list from another PackageSet and return the result.

type PackageSource

type PackageSource struct {
	License   string   `json:"license"`
	Version   string   `json:"version"`
	SourceRef string   `json:"source_ref"`
	Metadata  struct{} `json:"metadata"` // it's just an empty struct in lorax-composer
}

type PackageSpec

type PackageSpec struct {
	Name           string `json:"name"`
	Epoch          uint   `json:"epoch"`
	Version        string `json:"version,omitempty"`
	Release        string `json:"release,omitempty"`
	Arch           string `json:"arch,omitempty"`
	RemoteLocation string `json:"remote_location,omitempty"`
	Checksum       string `json:"checksum,omitempty"`
	Secrets        string `json:"secrets,omitempty"`
	CheckGPG       bool   `json:"check_gpg,omitempty"`
	IgnoreSSL      bool   `json:"ignore_ssl,omitempty"`
}

TODO: the public API of this package should not be reused for serialization.

func (*PackageSpec) GetEVRA

func (ps *PackageSpec) GetEVRA() string

GetEVRA returns the package's Epoch:Version-Release.Arch string

func (*PackageSpec) GetNEVRA

func (ps *PackageSpec) GetNEVRA() string

GetNEVRA returns the package's Name-Epoch:Version-Release.Arch string

type RPM

type RPM struct {
	Type      string  `json:"type"` // must be 'rpm'
	Name      string  `json:"name"`
	Version   string  `json:"version"`
	Release   string  `json:"release"`
	Epoch     *string `json:"epoch,omitempty"`
	Arch      string  `json:"arch"`
	Sigmd5    string  `json:"sigmd5"`
	Signature *string `json:"signature"`
}

func DeduplicateRPMs

func DeduplicateRPMs(rpms []RPM) []RPM

Deduplicate a list of RPMs based on NEVRA string

func (RPM) String

func (r RPM) String() string

NEVRA string for the package

type RepoConfig

type RepoConfig struct {
	// the repo id is not always required and is ignored in some cases.
	// For example, it is not required in dnf-json, but it is a required
	// field for creating a repo file in `/etc/yum.repos.d/`
	Id             string   `json:"id,omitempty"`
	Name           string   `json:"name,omitempty"`
	BaseURLs       []string `json:"baseurls,omitempty"`
	Metalink       string   `json:"metalink,omitempty"`
	MirrorList     string   `json:"mirrorlist,omitempty"`
	GPGKeys        []string `json:"gpgkeys,omitempty"`
	CheckGPG       *bool    `json:"check_gpg,omitempty"`
	CheckRepoGPG   *bool    `json:"check_repo_gpg,omitempty"`
	Priority       *int     `json:"priority,omitempty"`
	IgnoreSSL      *bool    `json:"ignore_ssl,omitempty"`
	MetadataExpire string   `json:"metadata_expire,omitempty"`
	ModuleHotfixes *bool    `json:"module_hotfixes,omitempty"`
	RHSM           bool     `json:"rhsm,omitempty"`
	Enabled        *bool    `json:"enabled,omitempty"`
	ImageTypeTags  []string `json:"image_type_tags,omitempty"`
	PackageSets    []string `json:"package_sets,omitempty"`

	// These fields are only filled out by the worker during the
	// depsolve job for certain baseurls.
	SSLCACert     string `json:"sslcacert,omitempty"`
	SSLClientKey  string `json:"sslclientkey,omitempty"`
	SSLClientCert string `json:"sslclientcert,omitempty"`
}

func (*RepoConfig) Hash

func (r *RepoConfig) Hash() string

Hash calculates an ID string that uniquely represents a repository configuration. The Name and ImageTypeTags fields are not considered in the calculation.

func (RepoConfig) MarshalJSON

func (r RepoConfig) MarshalJSON() ([]byte, error)

Backwards compatibility for old workers: This was added since the custom repository PR changes the baseurl field to a list of baseurls. This can be removed after 3 releases since the old-worker-regression test tests the current osbuild-composer with a worker from 3 releases ago

func (*RepoConfig) UnmarshalJSON

func (r *RepoConfig) UnmarshalJSON(data []byte) error

Backwards compatibility for old workers: This was added since the custom repository PR changes the baseurl field to a list of baseurls. This can be removed after 3 releases since the old-worker-regression test tests the current osbuild-composer with a worker from 3 releases ago

Jump to

Keyboard shortcuts

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