Conversation
src/it/test21-modifyversion/pom.xml
Outdated
| <version>1.0.1.redhat-00001</version> | ||
| <packaging>jar</packaging> | ||
|
|
||
| <name>Test Package #20</name> |
There was a problem hiding this comment.
This should be Test 21, not 20.
| String text = log() | ||
| return text.contains("Version : 1.0.1.redhat_00001") && | ||
| text.contains("Source RPM : test21-modifyversion-1.0.1.redhat_00001-1.src.rpm") |
There was a problem hiding this comment.
This works OK, but you could pull out just the text you need to make the comparison a little easier with
Process proc = ['rpm', '-q', '--queryformat', '"%{VERSION} %{SOURCERPM}"' ]then check
text == "1.0.1.redhat_00001 test21-modifyversion-1.0.1.redhat_00001-1.src.rpm"| version = version.replaceAll(versionSubstitution.search, versionSubstitution.replace); | ||
| } | ||
| } | ||
| return new RpmVersion(this.epoch, version, this.release); |
There was a problem hiding this comment.
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).
There was a problem hiding this comment.
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.
The reason for this enhancement is that if we have a typical RH version e.g.
1.1.0.redhat-00001then that utilises illegal characters in the version string - so this PR allows for an optional set of user-defined replacements for such characters.