Documentation ¶
Index ¶
- func GetVerStrFromPackageSpecList(pkgs []PackageSpec, packageName string) (string, error)
- func GetVerStrFromPackageSpecListPanic(pkgs []PackageSpec, packageName string) string
- func LoadRepositories(confPaths []string, distro string) (map[string][]RepoConfig, error)
- type DistrosRepoConfigs
- type Package
- type PackageBuild
- type PackageInfo
- type PackageList
- type PackageSet
- type PackageSource
- type PackageSpec
- type RPM
- type RepoConfig
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 LoadRepositories ¶
func LoadRepositories(confPaths []string, distro string) (map[string][]RepoConfig, error)
LoadRepositories loads distribution repositories from the given list of paths. If there are duplicate distro repositories definitions found in multiple paths, the first encounter is preferred. For this reason, the order of paths in the passed list should reflect the desired preference.
Types ¶
type DistrosRepoConfigs ¶
type DistrosRepoConfigs map[string]map[string][]RepoConfig
func LoadAllRepositories ¶
func LoadAllRepositories(confPaths []string) (DistrosRepoConfigs, error)
LoadAllRepositories loads all repositories for given distros from the given list of paths. Behavior is the same as with the LoadRepositories() method.
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 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 ¶
Deduplicate a list of RPMs based on NEVRA string
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"` }
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