Skip to content

Commit b4b7d56

Browse files
committed
refactor: use official semantic package instead of vendored version
1 parent 30e8a92 commit b4b7d56

File tree

3 files changed

+8
-211
lines changed

3 files changed

+8
-211
lines changed

detector/cve/cve202338408/cve202338408.go

+8-2
Original file line numberDiff line numberDiff line change
@@ -26,11 +26,11 @@ import (
2626
"strings"
2727

2828
"github.com/google/osv-scalibr/detector"
29-
"github.com/google/osv-scalibr/detector/cve/cve202338408/semantic"
3029
scalibrfs "github.com/google/osv-scalibr/fs"
3130
"github.com/google/osv-scalibr/inventoryindex"
3231
"github.com/google/osv-scalibr/log"
3332
"github.com/google/osv-scalibr/plugin"
33+
"github.com/google/osv-scalibr/semantic"
3434
)
3535

3636
const (
@@ -234,7 +234,13 @@ type fileLocations struct {
234234

235235
func versionLessEqual(lower, upper string) bool {
236236
// Version format looks like this: 3.7.1p2, 3.7, 3.2.3, 2.9p2
237-
return semantic.ParsePackagistVersion(lower).CompareStr(upper) <= 0
237+
r, err := semantic.MustParse(lower, "Packagist").CompareStr(upper)
238+
239+
if err != nil {
240+
panic(err)
241+
}
242+
243+
return r <= 0
238244
}
239245

240246
func findHistoryFiles() []string {

detector/cve/cve202338408/semantic/utilities.go

-58
This file was deleted.

detector/cve/cve202338408/semantic/version-packagist.go

-151
This file was deleted.

0 commit comments

Comments
 (0)