From da68b061e33ec5ae6aafe0316e6c2a148dae727f Mon Sep 17 00:00:00 2001 From: Masahiro Ono Date: Wed, 27 Jul 2016 13:15:13 +0900 Subject: [PATCH] Fix release string that contains "centos" --- scan/redhat.go | 1 - scan/redhat_test.go | 6 +++--- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/scan/redhat.go b/scan/redhat.go index cdc9d05b..d202850d 100644 --- a/scan/redhat.go +++ b/scan/redhat.go @@ -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 } diff --git a/scan/redhat_test.go b/scan/redhat_test.go index 24a4e785..68e44d65 100644 --- a/scan/redhat_test.go +++ b/scan/redhat_test.go @@ -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 `,