Commit e0dca753 authored by Mustafa Gezen's avatar Mustafa Gezen 🏗
Browse files

Fix no patch directive cases

parent 7de3f164
...@@ -210,6 +210,7 @@ func specChange(cfg *srpmprocpb.Cfg, pd *data.ProcessData, md *data.ModeData, _ ...@@ -210,6 +210,7 @@ func specChange(cfg *srpmprocpb.Cfg, pd *data.ProcessData, md *data.ModeData, _
inField := "" inField := ""
lastSource := "" lastSource := ""
lastPatch := "" lastPatch := ""
hasPatch := false
version := "" version := ""
importName := strings.Replace(pd.Importer.ImportName(pd, md), md.RpmFile.Name(), "1", 1) 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, _ ...@@ -239,6 +240,7 @@ func specChange(cfg *srpmprocpb.Cfg, pd *data.ProcessData, md *data.ModeData, _
lastSource = field lastSource = field
} else if strings.HasPrefix(field, "Patch") { } else if strings.HasPrefix(field, "Patch") {
lastPatch = field lastPatch = field
hasPatch = true
} else { } else {
for _, nf := range cfg.SpecChange.NewField { for _, nf := range cfg.SpecChange.NewField {
if field == nf.Key { if field == nf.Key {
...@@ -364,7 +366,7 @@ func specChange(cfg *srpmprocpb.Cfg, pd *data.ProcessData, md *data.ModeData, _ ...@@ -364,7 +366,7 @@ func specChange(cfg *srpmprocpb.Cfg, pd *data.ProcessData, md *data.ModeData, _
return err return err
} }
if executed && !strings.Contains(specStr, "Patch") { if executed && !hasPatch {
newLines = append(newLines, "") newLines = append(newLines, "")
inField = "Patch" inField = "Patch"
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment