Open asgeirn opened 8 years ago
It is an intentional design where user can upgrade existing snapshot rpm to release rpm.
My suggested modification does not change this behavior, Yum still treats 1.0.0 and 1.0.0-1 as updates to 1.0.0-SNAPSHOT. The only downside with my modification is that 1.0.0 and 1.0.0-1 get identical version and release values.
what about RPM -U ?
Yes, rpm -U behaves in the expected way. It permits upgrades from 1.0.0-SNAPSHOT to 1.0.0-alpha-1, and from 1.0.0-alpha-1 to 1.0.0. It does not permit upgrades from 1.0.0 to 1.0.0-1, since the plugin defaults the release to 1 if none is specified. Upgrading to 1.0.0-2 does however work.
And any attempt to go in the opposite direction is rejected on the basis of the version being older.
Since this is a new behavior, we still need to provide a flag to activate. If it works out well, we can make it default behavior on next major release(3)
Ok. I'm a bit rusty in Mojos, where would I need to define this flag?
any MOJO that uses src/main/java/org/codehaus/mojo/rpm/VersionHelper.java
VersionMojo and AbstractRPMMojo
Thanks for helping out
Please point to a doc that claims.
1.0.0-1 > 1.0.0-1_SNAPSHOTSNAPSHOT20160701004053
according to this https://fedoraproject.org/wiki/Archive:Tools/RPM/VersionComparison?rd=Tools/RPM/VersionComparison
1.0.0-1_SNAPSHOTSNAPSHOT20160701004053 is newer and therefore not upgradeable to 1.0.0-1
just tested out with your proposal to remove '_1' at release time
rpm -U brs-firewall-1.0.0-6.x86_64.rpm
it issues the following error
package brs-firewall-1.0.0-6_SNAPSHOT20160701221949.x86_64 (which is newer than brs-firewall-1.0.0-6.x86_64) is already installed
However, option without _1 is still a good use case, where we have projects that that continuously building RC/release builds. they stop building snapshot after entering RC build phase
Huh. What was the project versions in the POM used when building these two packages? It is a bit puzzling to me..
Den lør. 2. jul. 2016, 22:12 skrev Dan Tran notifications@github.com:
However, option without _1 is still a good use case, where we have projects that that continuously building RC/release builds. they stop building snapshot after entering RC build phase
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/mojohaus/rpm-maven-plugin/issues/55#issuecomment-230119856, or mute the thread https://github.com/notifications/unsubscribe/AADk9iN74RrwpQbFVq26E1tNZZJOJCK0ks5qRsYqgaJpZM4I_Ey7 .
I manually built those 2 artifacts to make you aware of the requirement
Given a POM version number of 1.0.0-1, I would expect the RPM plugin to produce an RPM with version 1.0.0 and release 1. This is numbering that is perfectly valid both for Maven and RPM.
Instead, it produces an RPM with version 1.0.0 and release 1_1.