Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Release Engineering
Public
srpmproc
Commits
db7390bc
Commit
db7390bc
authored
Jan 01, 2021
by
Mustafa Gezen
Browse files
add support for other stream ref patterns
parent
9de0f812
Changes
1
Hide whitespace changes
Inline
Side-by-side
internal/patch.go
View file @
db7390bc
...
...
@@ -292,13 +292,28 @@ func patchModuleYaml(pd *ProcessData, md *modeData) {
for
name
,
rpm
:=
range
module
.
Data
.
Components
.
Rpms
{
var
tipHash
string
if
strings
.
HasPrefix
(
rpm
.
Ref
,
"stream-"
)
{
rpm
.
Ref
=
md
.
pushBranch
tipHash
=
getTipStream
(
pd
,
name
,
md
.
pushBranch
)
var
pushBranch
string
split
:=
strings
.
Split
(
rpm
.
Ref
,
"-"
)
// 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
{
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
)
if
err
!=
nil
{
log
.
Fatalf
(
"could not marshal modulemd: %v"
,
err
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment