Manuel Amador (Rudd-O) wrote:
Hello, guys,


I have fixed distutils (and setuptools remains working) with the attached patch. Now, RPMs will be built according to the Fedora Package Naming Guidelines:


http://fedoraproject.org/wiki/Packaging/NamingGuidelines#Non-Numeric_Version_in_Release


which I understand to be the most useful reference in terms of naming pre-release packages. This should work correctly in at least:


- Fedora
- RHEL
- SUSE


I urge you patch your python 2.4s and 2.5s and 2.6s and push this update to distributions. I have done that myself at my own repository.


Now we can enjoy one more reason to build RPMs (and eggs! ... according to my workbench at http://yum.rudd-o.com/SCRIPTS/ -- feel free to pick its brains) DIRECTLY from the cheese shop, especially if you're using pip.


Oh, I also have pip at my repo (cd ../RPMS/noarch in my workbench).


See attached patch. I will log bugs where it corresponds too.
--


Manuel Amador (Rudd-O) <rudd-o@rudd-o.com>
Rudd-O.com - http://rudd-o.com/
GPG key ID 0xC8D28B92 at http://wwwkeys.pgp.net/


Now playing, courtesy of Amarok: Aqua - Cartoon heroes
Windows 95 is not a virus. Viruses actually do something.


Hi Manuel,
  You worked on my problem!  Great.
  So today what we have been doing to deal with the pre-release and lexical ordering problem involving pre-releases is this:
    We impose a restriction on how the pre-release is identified.  So for example if you intend to end up with a final version-release of 5.0.0-1 and you want to first put out some betas or release candidates then we have to name them as, 5.0.0-0_beta1, or 5.0.0-0_rc1 and this is so that the lexical ordering for RPM will be correct.  In other words you must put the pre-release designation into the 'release' part of VERSION-RELEASE.  What we had seen developers doing previously was to name these as 5.0.0_beta1 or 5.0.0_rc1 (making the pre-release designation part of the 'version' string)  which then did not work for the lexical ordering of the final release of 5.0.0-1 because 5.0.0 (version) was not lexically superior to 5.0.0_rc1.  So we were able to solve this problem without any code changes to distutils.  But this also presented a challenge for the other distribution targets such as 'sdist' because they were totally unaware of this 'version-release' combination and only knew about 'version'.  So as a workaround we were doing this:
# WORKAROUND
# define both version AND release
version='5.0.0'
release='1'
# combine them for all targets except 'bdist_rpm'
if sys.argv[1] != 'bdist_rpm':
    version = version+'-'+release
So this wasn't perfect but it actually worked quite well and we could get 'sdist' to work properly in conjunction with 'bdist_rpm'. 
So now with your patch all the targets should be able to set and use both 'version' and 'release' and we don't need our workaround and that will be great.

Regards,
Gerry