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 skipping version manipulation to avoid getting the version mangled #314

Open
ikus060 opened this issue Dec 14, 2020 · 6 comments
Open
Labels

Comments

@ikus060
Copy link

ikus060 commented Dec 14, 2020

The current implementation in Utils. convert a "java" version into a "debian" version. Trying to handle alhpa, beta, release. But It doesn't cover all the scenario and we should have an option to completely skip the version mangling an keep the version of the package.

e.g.: I'm using this version 3.7.1~dev24+g1b4b40e and it get transformed into 3.7.1~dev24+g1b4~b40e.

A simple option to skip the version mangling should be added to let the users manage it own version semantic.

@ikus060
Copy link
Author

ikus060 commented Dec 14, 2020

Manage to work around this by using a different property to inject that is not mangled by jdeb.

I'm using [[revision]] that is already injected in the build to define the version.

@ikus060 ikus060 closed this as completed Dec 14, 2020
@ebourg
Copy link
Collaborator

ebourg commented Dec 14, 2020

The mangling is clearly wrong in this case, the end of the +g1b4b40e suffix was parsed as a beta version and a ~ was inserted before the last b. I'm not sure to see how this could be avoided.

@ebourg ebourg reopened this Dec 14, 2020
@ebourg ebourg added the bug label Dec 14, 2020
@tcurdt
Copy link
Owner

tcurdt commented Feb 10, 2021

We should have a testcase that covers all those conversions. Maybe it would be good to start with a table of how conversions should look like.

@ukr357
Copy link

ukr357 commented Jan 20, 2025

I just observed the following in my build which seems to be related to this issue:
The version is 1.2.3~RC.0 and in the control file, the version ends up as 1.2.3~~RC.0. Also the changes file name ends with 1.2.3~~RC.0_all.changes. At the other places, the version seems to be correct. The debian file itself ends with 1.2.3~RC.0_all.deb.
This breaks my debian package. Unfortunately, I have not found a way to work around this problem. Is there a plan, when this can be fixed? Or do I miss something else?
Any help is very much appreciated!

@tcurdt
Copy link
Owner

tcurdt commented Jan 20, 2025

I think we first need to define all the expectations in the tests. Otherwise I don't see a chance of fixing this.

So if you could contribute your expectations here

assertEquals("should match", "1.0", Utils.convertToDebianVersion("1.0", false, "SNAPSHOT", null, cal.getTime()));

that would be great.

Repository owner deleted a comment from inglepriyanka148867 Jan 20, 2025
Repository owner deleted a comment from inglepriyanka148867 Jan 20, 2025
@ukr357
Copy link

ukr357 commented Jan 24, 2025

I don't have much time right now, so I just put the assertions below here, I hope you apologize for not making a proper PR.

In testVersionConversion:

assertEquals("should match", "1.0~SNAPSHOT", Utils.convertToDebianVersion("1.0~SNAPSHOT", false, "SNAPSHOT", null, cal.getTime()));
assertEquals("should match", "1.0~20130217000000", Utils.convertToDebianVersion("1.0~SNAPSHOT", true, "SNAPSHOT", null, cal.getTime()));
assertEquals("should match", "1.0~RC.2", Utils.convertToDebianVersion("1.0~RC.2", true, "SNAPSHOT", null, cal.getTime()));
assertEquals("should match", "1.0~alpha3", Utils.convertToDebianVersion("1.0~alpha3", true, "SNAPSHOT", null, cal.getTime()));
assertEquals("should match", "1.0~Beta+4", Utils.convertToDebianVersion("1.0~Beta-4", true, "SNAPSHOT", null, cal.getTime()));
assertEquals("should match", "1.0~milestone+4", Utils.convertToDebianVersion("1.0~milestone-4", true, "SNAPSHOT", null, cal.getTime()));
assertEquals("should match", "1.0~rc7", Utils.convertToDebianVersion("1.0~rc7", true, "SNAPSHOT", null, cal.getTime()));

In testVersionConversionWithTemplate:

assertEquals("should match", "1.0~20130217000000", Utils.convertToDebianVersion("1.0~SNAPSHOT", true, "SNAPSHOT", "[yyyyMMddHHmmss]", cal.getTime()));

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

No branches or pull requests

4 participants