mirror of
https://github.com/rocky-linux/srpmproc.git
synced 2024-06-02 08:10:17 +00:00
add support for other stream ref patterns
This commit is contained in:
parent
9de0f812f5
commit
db7390bc51
|
@ -292,13 +292,28 @@ func patchModuleYaml(pd *ProcessData, md *modeData) {
|
||||||
|
|
||||||
for name, rpm := range module.Data.Components.Rpms {
|
for name, rpm := range module.Data.Components.Rpms {
|
||||||
var tipHash string
|
var tipHash string
|
||||||
if strings.HasPrefix(rpm.Ref, "stream-") {
|
var pushBranch string
|
||||||
rpm.Ref = md.pushBranch
|
split := strings.Split(rpm.Ref, "-")
|
||||||
tipHash = getTipStream(pd, name, md.pushBranch)
|
// TODO: maybe point to correct release tag? but refer to latest for now,
|
||||||
|
// we're bootstrapping a new distro for latest RHEL8 anyways. So earlier
|
||||||
|
// versions are not that important
|
||||||
|
if strings.HasPrefix(rpm.Ref, "stream-rhel-") {
|
||||||
|
repString := fmt.Sprintf("rocky%ss-", string(split[4][0]))
|
||||||
|
newString := fmt.Sprintf("rocky%s-", string(split[4][0]))
|
||||||
|
pushBranch = strings.Replace(md.pushBranch, repString, newString, 1)
|
||||||
|
} else if strings.HasPrefix(rpm.Ref, "stream-") && len(split) == 2 {
|
||||||
|
pushBranch = md.pushBranch
|
||||||
|
} else if strings.HasPrefix(rpm.Ref, "stream-") {
|
||||||
|
pushBranch = fmt.Sprintf("rocky%s-stream-%s", string(split[3][0]), split[1])
|
||||||
|
} else if strings.HasPrefix(rpm.Ref, "rhel-") {
|
||||||
|
pushBranch = md.pushBranch
|
||||||
} else {
|
} else {
|
||||||
log.Fatal("could not recognize modulemd file, no stream- ref?")
|
log.Fatal("could not recognize modulemd ref")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
rpm.Ref = pushBranch
|
||||||
|
tipHash = getTipStream(pd, name, pushBranch)
|
||||||
|
|
||||||
err = module.Marshal(md.worktree.Filesystem, mdTxtPath)
|
err = module.Marshal(md.worktree.Filesystem, mdTxtPath)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Fatalf("could not marshal modulemd: %v", err)
|
log.Fatalf("could not marshal modulemd: %v", err)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user