Skip to content

Commit

Permalink
refactor: use official semantic package instead of vendored version
Browse files Browse the repository at this point in the history
  • Loading branch information
G-Rath committed Mar 6, 2025
1 parent 957c776 commit 93677bd
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 211 deletions.
10 changes: 8 additions & 2 deletions detector/cve/cve202338408/cve202338408.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,11 @@ import (
"strings"

"github.com/google/osv-scalibr/detector"
"github.com/google/osv-scalibr/detector/cve/cve202338408/semantic"
scalibrfs "github.com/google/osv-scalibr/fs"
"github.com/google/osv-scalibr/inventoryindex"
"github.com/google/osv-scalibr/log"
"github.com/google/osv-scalibr/plugin"
"github.com/google/osv-scalibr/semantic"
)

const (
Expand Down Expand Up @@ -234,7 +234,13 @@ type fileLocations struct {

func versionLessEqual(lower, upper string) bool {
// Version format looks like this: 3.7.1p2, 3.7, 3.2.3, 2.9p2
return semantic.ParsePackagistVersion(lower).CompareStr(upper) <= 0
r, err := semantic.MustParse(lower, "Packagist").CompareStr(upper)

if err != nil {
panic(err)
}

return r <= 0
}

func findHistoryFiles() []string {
Expand Down
58 changes: 0 additions & 58 deletions detector/cve/cve202338408/semantic/utilities.go

This file was deleted.

151 changes: 0 additions & 151 deletions detector/cve/cve202338408/semantic/version-packagist.go

This file was deleted.

0 comments on commit 93677bd

Please sign in to comment.