zafarkhaja / jsemver

Java implementation of the SemVer Specification
MIT License
429 stars 82 forks source link

Not able handle suffixed version #55

Closed wolandmaster closed 5 months ago

wolandmaster commented 4 years ago

The below example should return with true, but it doesn't.

final Version version = Version.valueOf("1.2.3-45");
final Expression expression = ExpressionParser.newInstance().parse("1.2.3-45");
System.out.println("satisfies: " + version.satisfies(expression));

Due to this problem, the microbean kubernetes helm library is not able to install helm charts that contain dependency charts.

asarkar commented 3 years ago

I don't think this library is maintained any more. You may want to check out https://github.com/asarkar/jsemver.

zafarkhaja commented 1 year ago

Hello Sandor! Sorry it took me this long to get back to you.

Most likely it's not relevant to you anymore, but I'm going to respond for future reference anyway :)

The situation is two-fold:

1) Because expressions grammar doesn't support pre-release versions, the expression on line 2 is translated to >=1.2.3 & <45.0.0, which is obviously not the same as version 1.2.3-45 from line 1.

2) And because pre-release versions have lower precedence than the associated normal version, the version 1.2.3-45 doesn't satisfy >=1.2.3.

zafarkhaja commented 1 year ago

Duplicate of #54.

zafarkhaja commented 5 months ago

Closing this issue in favor of #70, the progress can be followed from there.