Skip to content

Add version substitution support#106

Open
rnc wants to merge 1 commit intoctron:masterfrom
rnc:VERSION
Open

Add version substitution support#106
rnc wants to merge 1 commit intoctron:masterfrom
rnc:VERSION

Conversation

@rnc
Copy link
Copy Markdown
Collaborator

@rnc rnc commented Apr 17, 2025

The reason for this enhancement is that if we have a typical RH version e.g. 1.1.0.redhat-00001 then that utilises illegal characters in the version string - so this PR allows for an optional set of user-defined replacements for such characters.

Comment thread src/it/test21-modifyversion/pom.xml Outdated
Comment thread src/it/test21-modifyversion/verify.groovy Outdated
version = version.replaceAll(versionSubstitution.search, versionSubstitution.replace);
}
}
return new RpmVersion(this.epoch, version, this.release);
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If the version is invalid, it could eventually be detected here. Technically, the output filename doesn't have to be a valid RpmVersion, which means we would have to change RpmFileNameProvider to use String instead of RpmVersion, or it would fail at that point with using the non-transformed version (since makeVersion called with false there).

Copy link
Copy Markdown
Collaborator Author

@rnc rnc May 14, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I didn't want to change the output file name as that is what is used in maven storage (and is legal). I'm guessing you're referring to eclipse-packager/packager#76 which would break rpm-builder here if an invalid version is used ; I'm beginning to think the validation might actually cause more problems that it solves. Note also RpmFileNameProvider uses the RpmVersion to extract the release as well as the version.

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

Successfully merging this pull request may close these issues.

2 participants