diff --git a/syft/pkg/cataloger/binary/cataloger_test.go b/syft/pkg/cataloger/binary/cataloger_test.go index b470439c8..b4e686603 100644 --- a/syft/pkg/cataloger/binary/cataloger_test.go +++ b/syft/pkg/cataloger/binary/cataloger_test.go @@ -723,7 +723,7 @@ func Test_Cataloger_DefaultClassifiers_PositiveCases(t *testing.T) { Version: "25.3.2.7", Type: "binary", PURL: "pkg:generic/erlang@25.3.2.7", - Locations: locations("erlexec"), + Locations: locations("erlexec-25.3.2.7-2224b3107551c409fb8da6d85eaa1ed730d088db438924c97d6e25851381dd28-91724-100/erlexec"), Metadata: metadata("erlang-binary"), }, }, @@ -913,14 +913,6 @@ func assertPackagesAreEqual(t *testing.T, expected pkg.Package, p pkg.Package) { matches = false break } - if m1.Location.RealPath != "" && m1.Location.RealPath != m2.Location.RealPath { - matches = false - break - } - if m1.Location.AccessPath != "" && m1.Location.AccessPath != m2.Location.AccessPath { - matches = false - break - } } } else { matches = false @@ -941,8 +933,8 @@ func assertPackagesAreEqual(t *testing.T, expected pkg.Package, p pkg.Package) { cmp.Transformer("Locations", func(l file.LocationSet) []file.Location { return l.ToSlice() }), - cmpopts.IgnoreUnexported(pkg.Package{}, file.Location{}), - cmpopts.IgnoreFields(pkg.Package{}, "CPEs", "FoundBy", "MetadataType", "Type"), + cmpopts.IgnoreUnexported(pkg.Package{}, file.Location{}, file.LocationData{}, pkg.LicenseSet{}), + cmpopts.IgnoreFields(pkg.Package{}, "CPEs", "FoundBy", "Type", "Locations"), )) } } diff --git a/syft/pkg/cataloger/binary/default_classifiers.go b/syft/pkg/cataloger/binary/default_classifiers.go index e3ecd58b1..681233e41 100644 --- a/syft/pkg/cataloger/binary/default_classifiers.go +++ b/syft/pkg/cataloger/binary/default_classifiers.go @@ -288,7 +288,7 @@ var defaultClassifiers = []classifier{ FileGlob: "**/erlexec", EvidenceMatcher: fileContentsVersionMatcher( // [NUL]/usr/local/src/otp-25.3.2.7/erts/ - `(?m)\\x00/usr/local/src/otp-(?P[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+?)/erts/`, + `(?m)/usr/local/src/otp-(?P[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+?)/erts/`, ), Package: "erlang", PURL: mustPURL("pkg:generic/erlang@version"), diff --git a/syft/pkg/cataloger/binary/test-fixtures/classifiers/positive/erlang-25.3.2.7/erlexec b/syft/pkg/cataloger/binary/test-fixtures/classifiers/positive/erlang-25.3.2.7/erlexec deleted file mode 100644 index 9ad677967..000000000 Binary files a/syft/pkg/cataloger/binary/test-fixtures/classifiers/positive/erlang-25.3.2.7/erlexec and /dev/null differ diff --git a/syft/pkg/cataloger/binary/test-fixtures/classifiers/positive/erlang-25.3.2.7/erlexec-25.3.2.7-2224b3107551c409fb8da6d85eaa1ed730d088db438924c97d6e25851381dd28-91724-100/erlexec b/syft/pkg/cataloger/binary/test-fixtures/classifiers/positive/erlang-25.3.2.7/erlexec-25.3.2.7-2224b3107551c409fb8da6d85eaa1ed730d088db438924c97d6e25851381dd28-91724-100/erlexec new file mode 100644 index 000000000..9c3924d77 Binary files /dev/null and b/syft/pkg/cataloger/binary/test-fixtures/classifiers/positive/erlang-25.3.2.7/erlexec-25.3.2.7-2224b3107551c409fb8da6d85eaa1ed730d088db438924c97d6e25851381dd28-91724-100/erlexec differ