Red Hat Bugzilla – Bug 489644
distutils produces invalid RPM packages of prerelease python packages
Last modified: 2013-03-21 00:07:16 EDT
Description of problem:
Building pre-release python distutils packages with python setup.py bdist_rpm works, but the version number is "RPM-higher" than the official release package that is released later.
This constitutes a problem because many of the components in major Python apps like Zope -- distributed as cheese shop eggs and downloadable via pip or buildout -- are pre-release packages which, when turned into RPMs, contain RPM-invalid version numbers. The RPMs build, but the pre-release packages are considered "newer" by yum, so you can imagine the havoc that breaks.
Steps to Reproduce:
1. python setup.py bdist_rpm
2. inspect version / release number of resulting RPMs, find out it's wrong
3. do not profit!
distutils package version: 1.4a
rpm package version: 1.4a
patch attached. works against python 2.4, may apply fine to python 2.5 or 2.6 too since distutils hasn't undergone that big of a rewrite.
Created attachment 334745 [details]
fix for distutils
Heads up: The fix requires a patch (distributed with the python 2.4.x RPM in CentOS) to be applied first. I am attaching said patch so you can apply the fix.
Created attachment 334747 [details]
prerequisite fix for bdist_rpm
Created attachment 334758 [details]
updated for svnversions use case
the newest svnversions patch is to handle the case of people who want to build svn checkouts (usually versionnumbered by dev or dev-rXXXYYZZ). it overrides the release to be zero so they never upgrade alpha, beta packages.
You should create a separate BZ for the rpm change, and make this BZ depend on that ... however we don't change python in RHEL lightly, so if you really want this in RHEL I'd highly recommend creating a support request through the normal channels to get the priority bumped on this.
n/m the first part of the last comment ... I misread what you'd said. You just mean that there are two parts to the patch, to have it functional. Fair enough.
The part about bumping the priority still applies though.
ATM I am building my own Python RPMs from 2.4.5 source on RHEL to take care of this issue and to be able to install my own RPMified plone 3.2 packages, cuz otherwise it's "unpossible" as they say in the hood. I am of course being a good citizen and publishing these RPMs and SRPMs to my workbench / repo -- yum.rudd-o.com. I have 32 bit and 64 bit versions going on and working just fine. Feel free to take pointers from my SRPMs.
Created attachment 335057 [details]
replaces others, handles improvement of corner cases, provides packager with the ability to turn it off
Created attachment 335063 [details]
applies on top of the last one (lexicographical order), introduces automatic dependency detection based on egg metadata if available
Created attachment 335072 [details]
fixed lexicographical order patch
brown paper bug in the last lexic patch
I guess this never went through...
Distribute has probably the same problem.
Development Management has reviewed and declined this request.
You may appeal this decision by reopening this request.