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
9a6c027d
Commit
9a6c027d
authored
Feb 24, 2021
by
Mustafa Gezen
Browse files
use req.operation
parent
01380b9b
Changes
1
Hide whitespace changes
Inline
Side-by-side
internal/directives/spec_change.go
View file @
9a6c027d
...
...
@@ -24,6 +24,7 @@ type sourcePatchOperationInLoopRequest struct {
lastNum
*
int
in
*
bool
expectedField
string
operation
srpmprocpb
.
SpecChange_FileOperation_Type
}
type
sourcePatchOperationAfterLoopRequest
struct
{
...
...
@@ -40,7 +41,7 @@ type sourcePatchOperationAfterLoopRequest struct {
func
sourcePatchOperationInLoop
(
req
*
sourcePatchOperationInLoopRequest
)
error
{
if
strings
.
HasPrefix
(
req
.
field
,
req
.
expectedField
)
{
for
_
,
file
:=
range
req
.
cfg
.
SpecChange
.
File
{
if
file
.
Type
!=
srpmprocpb
.
SpecChange_FileO
peration
_Source
{
if
file
.
Type
!=
req
.
o
peration
{
continue
}
...
...
@@ -223,8 +224,9 @@ func specChange(cfg *srpmprocpb.Cfg, pd *data.ProcessData, md *data.ModeData, _
value
:
&
value
,
lastNum
:
&
lastSourceNum
,
longestField
:
longestField
,
expectedField
:
"Source"
,
in
:
&
inSources
,
expectedField
:
"Source"
,
operation
:
srpmprocpb
.
SpecChange_FileOperation_Source
,
})
if
err
!=
nil
{
return
err
...
...
@@ -238,6 +240,7 @@ func specChange(cfg *srpmprocpb.Cfg, pd *data.ProcessData, md *data.ModeData, _
lastNum
:
&
lastPatchNum
,
in
:
&
inPatches
,
expectedField
:
"Patch"
,
operation
:
srpmprocpb
.
SpecChange_FileOperation_Patch
,
})
if
err
!=
nil
{
return
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