OpenERP v5.0.0_rc3: pre-release versioning conflicts with RPM ordering

Bug #314575 reported by Gerry Reno
This bug report is a duplicate of:  Bug #311981: OpenERP v5.0.0_rc2: bdist_rpm fails. Edit Remove
2
Affects Status Importance Assigned to Milestone
Odoo GTK Client (MOVED TO GITHUB)
Fix Released
Undecided
Unassigned
Odoo Server (MOVED TO GITHUB)
Fix Released
Undecided
Unassigned
Odoo Web Client
New
Undecided
Unassigned

Bug Description

In OpenERP v5.0.0 the versioning for the pre-release candidates is made by adding a suffix to the "version" string. Eg: 5.0.0_rc3. This type of versioning conflicts with RPM ordering and updating (generated using 'bdist_rpm' target to setup.py). The final RPM release package, 5.0.0, will not update an RPM package identified as 5.0.0_rc3. How Fedora has been dealing with this is to put the pre-release candidate designation into a 'release' string in their spec files.
For example:
Pre-release candidate: rc2
Upstream: foo-5.0.0_rc2
Rpm Version: 5.0.0
Rpm Release: 0_rc2

Final release:
Upstream: foo-5.0.0
Rpm Version: 5.0.0
Rpm Release: 1

Now the final RPM release, 5.0.0-1, will update 5.0.0-0_rc2

I have submitted patches in the comments below that accomplish the above type of VERSION-RELEASE ordering.
So now we can use the following for the various VERSION-RELEASE strings:

Development code:
version="5.0.0" release="0_00012345" (where 00012345 is the revision number from bzr in left zero-padded field of 8)
tarball: foo-5.0.0-0_00012345.tar.gz rpm: foo-5.0.0-0_00012345.noarch.rpm

Alpha code:
version="5.0.0" release="0_alpha1_00123456"
tarball: foo-5.0.0-0_alpha1_00123456.tar.gz rpm: foo-5.0.0-0_alpha1_00123456.noarch.rpm

Beta code:
version="5.0.0" release="0_beta1_00234567"
tarball: foo-5.0.0-0_beta1_00234567.tar.gz rpm: foo-5.0.0-0_beta1_00234567.noarch.rpm

Release Candidate code:
version="5.0.0" release="0_rc1"
tarball: foo-5.0.0-0_rc1.tar.gz rpm: foo-5.0.0-0_rc1.noarch.rpm

Release Candidate code fix:
version="5.0.0" release="0_rc1_00345678"
tarball: foo-5.0.0-0_rc1_00345678.tar.gz rpm: foo-5.0.0-0_rc1_00345678.noarch.rpm

Final Release code:
version="5.0.0" release="1"
tarball: foo-5.0.0-1.tar.gz rpm: foo-5.0.0-1.noarch.rpm

Notice that lexical ordering is proper in all cases. Even where the alpha, beta, rc releases may be followed by a bzr fix revision.
The ensures that both tarballs and packages such as rpm will contain the same VERSION-RELEASE designations.

description: updated
Revision history for this message
Gerry Reno (greno-verizon) wrote :

I have opened a thread on distutils-sig and have proposed changes to distutils to properly handle 'version' and 'release' strings between all the various distutils targets. This has been a big problem that has plagued distro packagers of python apps for RPM-based distros and caused them to use mechanisms other than 'bdist_rpm' for generating RPMS which has led to much confusion. If the proposed changes are made to distutils then distro packagers will find coordinated behavior between the targets such as 'sdist' and 'bdist_XXX'.
In the meantime I have created a solution that can be used immediately and will work with 'sdist' and 'bdist_XXX' for OpenERP.
The names generated will match with the proposed distutils changes.

Patches against client revision 878:
===========================================================
Client Patch for bin/release.py:
25c25,32
< version = '5.0.0_rc3'
---
> # here the version must always be set to numeric: 'N.N.N', eg: '5.0.0'
> version = '5.0.0'
> # pre-release candidates: release='0_rcX'(X=rc version), eg: '0_rc2', we preface with '0_' to ensure lexical ordering
> # final release: release='1', ensures final release is always lexically greater than the pre-release candidates.
> # in setup.cfg in [bdist_rpm] make sure 'release' matches release as set here.
> release = '0_rc3'
> if sys.argv[1] != 'bdist_rpm':
> version = version+'-'+release
===========================================================
Client Patch for setup.cfg:
8c8,9
< release=1
---
> # release must match 'release' as set in bin/release.py
> release=0_rc3
===========================================================

Patches against server revision 1596
===========================================================
Server Patch for bin/release.py:
25c25,32
< version = '5.0.0_rc3'
---
> # here the version must always be set to numeric: 'N.N.N', eg: '5.0.0'
> version = '5.0.0'
> # pre-release candidates: release='0_rcX'(X=rc version), eg: '0_rc2', we preface with '0_' to ensure lexical ordering
> # final release: release='1', ensures final release is always lexically greater than the pre-release candidates.
> # in setup.cfg in [bdist_rpm] make sure 'release' matches release as set here.
> release = '0_rc3'
> if sys.argv[1] != 'bdist_rpm':
> version = version+'-'+release
===========================================================
Server Patch for setup.cfg:
8c8,9
< release=1
---
> # release must match 'release' as set in bin/release.py
> release=0_rc3
===========================================================

These patches solve the conflicting RPM ordering for OpenERP client and server.
There also needs to be a similar mechanism created for client-web as well. I did not have time to look into that.
-Gerry

description: updated
description: updated
description: updated
Changed in openobject-client:
status: New → Fix Released
Changed in openobject-server:
status: New → Fix Released
description: updated
description: updated
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.