Fix release string that contains "centos"

This commit is contained in:
Masahiro Ono
2016-07-27 13:15:13 +09:00
parent 6c3802071f
commit da68b061e3
2 changed files with 3 additions and 4 deletions

View File

@@ -580,7 +580,6 @@ func (o *redhat) parseAllChangelog(allChangelog string) (map[string]*string, err
for _, rpm := range rpms {
rpm = strings.TrimSpace(rpm)
rpm = o.regexpReplace(rpm, `^[0-9]+:`, "")
rpm = o.regexpReplace(rpm, `\.centos([.0-9]+)?\.(i386|i486|i586|i686|k6|athlon|x86_64|noarch|ppc|alpha|sparc)$`, "")
rpm = o.regexpReplace(rpm, `\.(i386|i486|i586|i686|k6|athlon|x86_64|noarch|ppc|alpha|sparc)$`, "")
rpm2changelog[rpm] = pNewString
}

View File

@@ -1046,7 +1046,7 @@ func TestGetChangelogCVELines(t *testing.T) {
models.PackageInfo{
Name: "centos-release",
NewVersion: "6",
NewRelease: "8.el6",
NewRelease: "8.el6.centos.12.3",
},
`- TESTSTRING CVE-0000-0000
`,
@@ -1055,7 +1055,7 @@ func TestGetChangelogCVELines(t *testing.T) {
models.PackageInfo{
Name: "dhclient",
NewVersion: "4.1.1",
NewRelease: "51.P1.el6",
NewRelease: "51.P1.el6.centos",
},
`- TESTSTRING CVE-1111-1111
`,
@@ -1064,7 +1064,7 @@ func TestGetChangelogCVELines(t *testing.T) {
models.PackageInfo{
Name: "dhcp-common",
NewVersion: "4.1.1",
NewRelease: "51.P1.el6",
NewRelease: "51.P1.el6.centos",
},
`- TESTSTRING CVE-1111-1111
`,