Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 5ea1d78

Browse files
committed
rename helper fn to toELVersion
Signed-off-by: Alex Goodman <[email protected]>
1 parent afbd8f8 commit 5ea1d78

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

syft/pkg/cataloger/rpmdb/parse_rpmdb.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ func parseRpmDB(resolver source.FilePathResolver, dbLocation source.Location, re
6262

6363
p := pkg.Package{
6464
Name: entry.Name,
65-
Version: toElVersion(metadata),
65+
Version: toELVersion(metadata),
6666
Locations: []source.Location{dbLocation},
6767
FoundBy: catalogerName,
6868
Type: pkg.RpmPkg,
@@ -78,11 +78,11 @@ func parseRpmDB(resolver source.FilePathResolver, dbLocation source.Location, re
7878

7979
// The RPM naming scheme is [name]-[version]-[release]-[arch], where version is implicitly expands to [epoch]:[version].
8080
// RPM version comparison depends on comparing at least the version and release fields together as a subset of the
81-
// naming scheme. This toElVersion function takes a RPM DB package information and converts it into a minimally comparable
81+
// naming scheme. This toELVersion function takes a RPM DB package information and converts it into a minimally comparable
8282
// version string, containing epoch (optional), version, and release information. Epoch is an optional field and can be
8383
// assumed to be 0 when not provided for comparison purposes, however, if the underlying RPM DB entry does not have
8484
// an epoch specified it would be slightly disingenuous to display a value of 0.
85-
func toElVersion(metadata pkg.RpmdbMetadata) string {
85+
func toELVersion(metadata pkg.RpmdbMetadata) string {
8686
if metadata.Epoch != nil {
8787
return fmt.Sprintf("%d:%s-%s", *metadata.Epoch, metadata.Version, metadata.Release)
8888
}

syft/pkg/cataloger/rpmdb/parse_rpmdb_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,7 @@ func TestToElVersion(t *testing.T) {
199199

200200
for _, test := range tests {
201201
t.Run(test.name, func(t *testing.T) {
202-
assert.Equal(t, test.expected, toElVersion(test.entry))
202+
assert.Equal(t, test.expected, toELVersion(test.entry))
203203
})
204204
}
205205
}

0 commit comments

Comments
 (0)