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

Malformed version for linux kernel #70

Open
wagdez opened this issue Feb 5, 2020 · 2 comments
Open

Malformed version for linux kernel #70

wagdez opened this issue Feb 5, 2020 · 2 comments

Comments

@wagdez
Copy link

wagdez commented Feb 5, 2020

when trying to create a newVersion for the amazon1/2 (and other distros) kernel version (output of uname -r) it reports a Malformed version.
for example: 4.14.77-70.59.amzn1.x86_64
A short investigation shows that the "_" in the x86_64 is the problem.

A short code to reproduce it:
package main

import (
"fmt"
version "github.com/hashicorp/go-version"
)

func main() {
v1, err := version.NewVersion("4.4.23-31.54.amzn1.x86_64")
if err != nil {
fmt.Printf("Error %v\n", err)
return
} else {
fmt.Printf("Got version %v\n", v1)
}
}

@danishprakash
Copy link

danishprakash commented Jul 4, 2021

An underscore _, it seems, isn't supported in build numbers in semver but a fix for this issue, which I think is a legit issue btw, involves adding _ to the various match groups in the regex pattern but would cause this project to drift away from semver. Would love to hear from the members on this. cc/ @mitchellh

@martijnvdp
Copy link

martijnvdp commented Jan 4, 2022

Yes i had already made a pr, but i also can imagine that they want to keep the underscore out as its not inline with semver,
oh this is open since 2020..

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants