Skip to content

Commit 18c147c

Browse files
authored
feat: support comparing Ubuntu versions (#300)
1 parent 68b0e31 commit 18c147c

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

pkg/semantic/parse.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,8 @@ func Parse(str string, ecosystem internal.Ecosystem) (Version, error) {
4545
return parsePyPIVersion(str), nil
4646
case "RubyGems":
4747
return parseRubyGemsVersion(str), nil
48+
case "Ubuntu":
49+
return parseDebianVersion(str), nil
4850
}
4951

5052
return nil, fmt.Errorf("%w %s", ErrUnsupportedEcosystem, ecosystem)

pkg/semantic/parse_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ func TestParse(t *testing.T) {
1414
ecosystems := lockfile.KnownEcosystems()
1515

1616
// todo: remove once CRAN is supported by lockfile
17-
ecosystems = append(ecosystems, "CRAN")
17+
ecosystems = append(ecosystems, "CRAN", "Ubuntu")
1818

1919
for _, ecosystem := range ecosystems {
2020
_, err := semantic.Parse("", ecosystem)
@@ -37,7 +37,7 @@ func TestMustParse(t *testing.T) {
3737
ecosystems := lockfile.KnownEcosystems()
3838

3939
// todo: remove once CRAN is supported by lockfile
40-
ecosystems = append(ecosystems, "CRAN")
40+
ecosystems = append(ecosystems, "CRAN", "Ubuntu")
4141

4242
for _, ecosystem := range ecosystems {
4343
semantic.MustParse("", ecosystem)

0 commit comments

Comments
 (0)