Move rpmStageInputs() from distros to osbuild2
Move the `rpmStageInputs()` function duplicated in all distro definitions to the `osbuild2` package as `NewRpmStageSourceFilesInputs()`. Signed-off-by: Tomas Hozza <thozza@redhat.com>
This commit is contained in:
parent
8e6826e743
commit
069423ea67
10 changed files with 43 additions and 111 deletions
|
|
@ -107,3 +107,19 @@ func RPMPackageMetadataToSignature(pkg RPMPackageMetadata) *string {
|
|||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func NewRpmStageSourceFilesInputs(specs []rpmmd.PackageSpec) *RPMStageInputs {
|
||||
stageInput := new(RPMStageInput)
|
||||
stageInput.Type = "org.osbuild.files"
|
||||
stageInput.Origin = "org.osbuild.source"
|
||||
stageInput.References = pkgRefs(specs)
|
||||
return &RPMStageInputs{Packages: stageInput}
|
||||
}
|
||||
|
||||
func pkgRefs(specs []rpmmd.PackageSpec) RPMStageReferences {
|
||||
refs := make([]string, len(specs))
|
||||
for idx, pkg := range specs {
|
||||
refs[idx] = pkg.Checksum
|
||||
}
|
||||
return refs
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue