mirror of
https://github.com/rocky-linux/srpmproc.git
synced 2025-01-06 00:20:56 +00:00
Fix no patch directive cases
This commit is contained in:
parent
7de3f16426
commit
e0dca75367
1 changed files with 3 additions and 1 deletions
|
@ -210,6 +210,7 @@ func specChange(cfg *srpmprocpb.Cfg, pd *data.ProcessData, md *data.ModeData, _
|
|||
inField := ""
|
||||
lastSource := ""
|
||||
lastPatch := ""
|
||||
hasPatch := false
|
||||
|
||||
version := ""
|
||||
importName := strings.Replace(pd.Importer.ImportName(pd, md), md.RpmFile.Name(), "1", 1)
|
||||
|
@ -239,6 +240,7 @@ func specChange(cfg *srpmprocpb.Cfg, pd *data.ProcessData, md *data.ModeData, _
|
|||
lastSource = field
|
||||
} else if strings.HasPrefix(field, "Patch") {
|
||||
lastPatch = field
|
||||
hasPatch = true
|
||||
} else {
|
||||
for _, nf := range cfg.SpecChange.NewField {
|
||||
if field == nf.Key {
|
||||
|
@ -364,7 +366,7 @@ func specChange(cfg *srpmprocpb.Cfg, pd *data.ProcessData, md *data.ModeData, _
|
|||
return err
|
||||
}
|
||||
|
||||
if executed && !strings.Contains(specStr, "Patch") {
|
||||
if executed && !hasPatch {
|
||||
newLines = append(newLines, "")
|
||||
inField = "Patch"
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue