-
Notifications
You must be signed in to change notification settings - Fork 33
Add version substitution support #106
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
Open
rnc
wants to merge
1
commit into
ctron:master
Choose a base branch
from
rnc:VERSION
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+148
−9
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,86 @@ | ||
| <?xml version="1.0" encoding="UTF-8"?> | ||
| <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
| xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> | ||
| <modelVersion>4.0.0</modelVersion> | ||
|
|
||
| <groupId>de.dentrassi.maven.rpm.test</groupId> | ||
| <artifactId>test21-modifyversion</artifactId> | ||
| <version>1.0.1.redhat-00001</version> | ||
| <packaging>jar</packaging> | ||
|
|
||
| <name>Test Package #21</name> | ||
| <description>Test modify version generation</description> | ||
|
|
||
| <url>https://dentrassi.de</url> | ||
|
|
||
| <organization> | ||
| <name>Jens Reimann</name> | ||
| <url>http://dentrassi.de</url> | ||
| </organization> | ||
|
|
||
| <licenses> | ||
| <license> | ||
| <name>Eclipse Public License - v 1.0</name> | ||
| <distribution>repo</distribution> | ||
| <url>https://www.eclipse.org/legal/epl-v10.html</url> | ||
| </license> | ||
| </licenses> | ||
|
|
||
| <properties> | ||
| <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> | ||
| <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding> | ||
| <skipSigning>true</skipSigning> | ||
| </properties> | ||
|
|
||
| <build> | ||
|
|
||
| <plugins> | ||
| <plugin> | ||
| <groupId>de.dentrassi.maven</groupId> | ||
| <artifactId>rpm</artifactId> | ||
| <version>@project.version@</version> | ||
| <executions> | ||
| <execution> | ||
| <goals> | ||
| <goal>rpm</goal> | ||
| </goals> | ||
| <configuration> | ||
| <attach>false</attach> | ||
| <group>Application/Misc</group> | ||
|
|
||
| <modifyVersion>true</modifyVersion> | ||
| <versionReplacements> | ||
| <versionReplacement> | ||
| <search>-</search> | ||
| <replace>_</replace> | ||
| </versionReplacement> | ||
| </versionReplacements> | ||
|
|
||
| <signature> | ||
| <keyId>${keyId}</keyId> | ||
| <keyringFile>${user.home}/.gnupg/secring.gpg</keyringFile> | ||
| <passphrase>${passphrase}</passphrase> | ||
| <hashAlgorithm>SHA1</hashAlgorithm> | ||
| <skip>${skipSigning}</skip> | ||
| </signature> | ||
|
|
||
| </configuration> | ||
| </execution> | ||
| </executions> | ||
| </plugin> | ||
| </plugins> | ||
| </build> | ||
|
|
||
| <profiles> | ||
| <profile> | ||
| <id>sign</id> | ||
| <activation> | ||
| <activeByDefault>false</activeByDefault> | ||
| </activation> | ||
| <properties> | ||
| <skipSigning>false</skipSigning> | ||
| </properties> | ||
| </profile> | ||
| </profiles> | ||
|
|
||
| </project> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,8 @@ | ||
|
|
||
| def log () { | ||
| Process proc = ['rpm', '-q', '--queryformat', '[%{VERSION} %{SOURCERPM}]', basedir.toString() + "/target/test21-modifyversion-1.0.1.redhat-00001-1.noarch.rpm"].execute(); | ||
| return proc.in.getText().trim(); | ||
| } | ||
|
|
||
| String text = log() | ||
| return text.contains("1.0.1.redhat_00001 test21-modifyversion-1.0.1.redhat_00001-1.src.rpm") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
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 changeRpmFileNameProviderto useStringinstead ofRpmVersion, or it would fail at that point with using the non-transformed version (sincemakeVersioncalled withfalsethere).Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
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#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.