OpenERP v5.0.0_rc3: pre-release versioning conflicts with RPM ordering
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=
tarball: foo-5.0.
Alpha code:
version="5.0.0" release=
tarball: foo-5.0.
Beta code:
version="5.0.0" release=
tarball: foo-5.0.
Release Candidate code:
version="5.0.0" release="0_rc1"
tarball: foo-5.0.
Release Candidate code fix:
version="5.0.0" release=
tarball: foo-5.0.
Final Release code:
version="5.0.0" release="1"
tarball: foo-5.0.0-1.tar.gz rpm: foo-5.0.
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 |
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 |
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: ======= ======= ======= ======= ======= ======= ======= === '0_rcX' (X=rc version), eg: '0_rc2', we preface with '0_' to ensure lexical ordering ======= ======= ======= ======= ======= ======= ======= === ======= ======= ======= ======= ======= ======= ======= ===
=======
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=
> # 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 ======= ======= ======= ======= ======= ======= ======= === '0_rcX' (X=rc version), eg: '0_rc2', we preface with '0_' to ensure lexical ordering ======= ======= ======= ======= ======= ======= ======= === ======= ======= ======= ======= ======= ======= ======= ===
=======
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=
> # 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