zafarkhaja/jsemver

Not able handle suffixed version

Closed this issue · 4 comments

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.

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

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.

Duplicate of #54.

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