Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow non-semver packages in the Conan package registry #20412

Merged
merged 10 commits into from
Jul 22, 2022
4 changes: 1 addition & 3 deletions modules/packages/conan/reference.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@ import (
"regexp"

"code.gitea.io/gitea/modules/log"

goversion "github.com/hashicorp/go-version"
)

const (
Expand Down Expand Up @@ -56,7 +54,7 @@ func NewRecipeReference(name, version, user, channel, revision string) (*RecipeR
if !namePattern.MatchString(name) {
return nil, ErrValidation
}
if _, err := goversion.NewSemver(version); err != nil {
if strings.TrimSpace(version) == "" {
algernon marked this conversation as resolved.
Show resolved Hide resolved
return nil, ErrValidation
}
if user != "" && !namePattern.MatchString(user) {
Expand Down
1 change: 1 addition & 0 deletions modules/packages/conan/reference_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ func TestNewRecipeReference(t *testing.T) {
{"name", "1.0", "_", "_", "", true},
{"name", "1.0", "_", "_", "0", true},
{"name", "1.0", "", "", "0", true},
{"name", "1.0.0q", "", "", "0", true},
{"name", "1.0", "", "", "000000000000000000000000000000000000000000000000000000000000", false},
}

Expand Down