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
0c150ed1
Commit
0c150ed1
authored
Feb 20, 2021
by
Mustafa Gezen
Browse files
change default branch to "main" and rollback faulty change
parent
541f446a
Changes
2
Hide whitespace changes
Inline
Side-by-side
internal/patch.go
View file @
0c150ed1
...
...
@@ -204,7 +204,7 @@ func executePatchesRpm(pd *ProcessData, md *modeData) {
return
}
else
{
err
=
w
.
Checkout
(
&
git
.
CheckoutOptions
{
Branch
:
plumbing
.
NewRemoteReferenceName
(
"origin"
,
"ma
ster
"
),
Branch
:
plumbing
.
NewRemoteReferenceName
(
"origin"
,
"ma
in
"
),
Force
:
true
,
})
// common patches found, apply them
...
...
@@ -303,6 +303,9 @@ func patchModuleYaml(pd *ProcessData, md *modeData) {
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-"
)
&&
len
(
split
)
==
3
{
// example: ant
pushBranch
=
fmt
.
Sprintf
(
"%s%d-stream-%s"
,
pd
.
BranchPrefix
,
pd
.
Version
,
split
[
2
])
}
else
if
strings
.
HasPrefix
(
rpm
.
Ref
,
"stream-"
)
{
pushBranch
=
fmt
.
Sprintf
(
"%s%s-stream-%s"
,
pd
.
BranchPrefix
,
string
(
split
[
3
][
0
]),
split
[
1
])
}
else
if
strings
.
HasPrefix
(
rpm
.
Ref
,
"rhel-"
)
{
...
...
internal/process.go
View file @
0c150ed1
...
...
@@ -79,7 +79,7 @@ func ProcessRPM(pd *ProcessData) {
remotePrefix
=
"modules"
}
var
pushedHashes
[
]
string
latestHashForBranch
:=
map
[
string
]
string
{}
// already uploaded blobs are skipped
var
alreadyUploadedBlobs
[]
string
...
...
@@ -122,7 +122,6 @@ func ProcessRPM(pd *ProcessData) {
sourceWorktree
:=
*
md
.
worktree
for
_
,
branch
:=
range
md
.
branches
{
md
.
sourcesToIgnore
=
[]
*
ignoredSource
{}
md
.
repo
=
&
sourceRepo
md
.
worktree
=
&
sourceWorktree
md
.
tagBranch
=
branch
...
...
@@ -130,6 +129,10 @@ func ProcessRPM(pd *ProcessData) {
source
.
expired
=
true
}
if
strings
.
Contains
(
md
.
tagBranch
,
"-beta"
)
{
continue
}
rpmFile
:=
md
.
rpmFile
// create new repo for final dist
repo
,
err
:=
git
.
Init
(
memory
.
NewStorage
(),
memfs
.
New
())
...
...
@@ -292,6 +295,18 @@ func ProcessRPM(pd *ProcessData) {
status
,
_
:=
w
.
Status
()
log
.
Printf
(
"successfully processed:
\n
%s"
,
status
)
statusLines
:=
strings
.
Split
(
status
.
String
(),
"
\n
"
)
for
_
,
line
:=
range
statusLines
{
trimmed
:=
strings
.
TrimSpace
(
line
)
if
strings
.
HasPrefix
(
trimmed
,
"D"
)
{
path
:=
strings
.
TrimPrefix
(
trimmed
,
"D "
)
_
,
err
:=
w
.
Remove
(
path
)
if
err
!=
nil
{
log
.
Fatalf
(
"could not delete extra file %s: %v"
,
path
,
err
)
}
}
}
var
hashes
[]
plumbing
.
Hash
var
pushRefspecs
[]
config
.
RefSpec
...
...
@@ -353,10 +368,10 @@ func ProcessRPM(pd *ProcessData) {
}
hashString
:=
obj
.
Hash
.
String
()
pushedHashes
=
append
(
pushedHashes
,
fmt
.
Sprintf
(
"%s:%s"
,
md
.
pushBranch
,
hashString
))
latestHashForBranch
[
md
.
pushBranch
]
=
hashString
}
err
:=
json
.
NewEncoder
(
os
.
Stdout
)
.
Encode
(
pushedHashes
)
err
:=
json
.
NewEncoder
(
os
.
Stdout
)
.
Encode
(
latestHashForBranch
)
if
err
!=
nil
{
log
.
Fatalf
(
"could not print hashes"
)
}
...
...
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