[Distutils] SOLVED: bdist_rpm and pre-release python packages / eggs (was: pre-release versioning problems with sdist, bdist_rpm, bdist_debian)

Manuel Amador (Rudd-O) rudd-o at rudd-o.com
Fri Mar 13 06:45:44 CET 2009

OK, Gerry, I have addressed your concerns.

1) Note that the release number is still squelched in the case of RPMs 
compiled from SVN checkouts of distutils packages.  This is so that alpha, 
beta or release candidate packages can upgrade SVN checkouts without extra 
intervention from the packager.  Alpha, beta and rc packages do obey the 
release variable just fine.  The whole intention here is to put a sensible 
release variable and a sensible version variable when no release variable was 
2) I have used a relsep variable that you can tweak to use a dot or an 
elephant if your package policy wants that (note that the Mandrake policy says 
nothing about that).
3) If anything non-numeric is specified in the release, then you as a packager 
are indicating that you do not want this automatic behavior and the 
modifications are automatically skipped.  Note that the whole point of the 
patch is to AVOID this extra work of specifying the release for prerelease 
4) The cases you spoke about are addressed.

Attached is the patch.  Here is a map table with the default release (which 
happens to be "1":

[rudd-o at tobey ~]$ for a in `cat versions` ; do python bdist_rpm.py rewrite $a 
1 ; done
1.0-1           1.0-1
1.1-1           1.1-1
1.1a-1          1.1-0.1.a
1.1a2-1         1.1-0.1.a2
1.1b1-1         1.1-0.1.b1
1.1dev-1                1.1-0.0.dev
1.1svn-1                1.1-0.0.svn
1.1dev-r56554-1         1.1-0.0.56554dev
1.1svn-r400-1           1.1-0.0.400svn
1.1svn-r401-1           1.1-0.0.401svn
1.2svn-r34-1            1.2-0.0.34svn
5.5rc2-1                5.5-0.1.rc2
0.9-1           0.9-1
0.9.8-1         0.9.8-1
20080706-1              20080706-1
A2005-1         A2005-1
ABCDEF15-1              ABCDEF15-1
abc45-1         abc45-1
0.9alpha23-1            0.9-0.1.alpha23
A2-1            A2-1

Now here is a map table with a release with a non-integer release:

[rudd-o at tobey ~]$ for a in `cat versions` ; do python bdist_rpm.py rewrite $a 
0_1 ; done
1.0-0_1         1.0-0_1
1.1-0_1         1.1-0_1
1.1a-0_1                1.1a-0_1
1.1a2-0_1               1.1a2-0_1
1.1b1-0_1               1.1b1-0_1
1.1dev-0_1              1.1dev-0_1
1.1svn-0_1              1.1svn-0_1
1.1dev-r56554-0_1               1.1dev_r56554-0_1
1.1svn-r400-0_1         1.1svn_r400-0_1
1.1svn-r401-0_1         1.1svn_r401-0_1
1.2svn-r34-0_1          1.2svn_r34-0_1
5.5rc2-0_1              5.5rc2-0_1
0.9-0_1         0.9-0_1
0.9.8-0_1               0.9.8-0_1
20080706-0_1            20080706-0_1
A2005-0_1               A2005-0_1
ABCDEF15-0_1            ABCDEF15-0_1
abc45-0_1               abc45-0_1
0.9alpha23-0_1          0.9alpha23-0_1
A2-0_1          A2-0_1

I hope the next note you have about this patch is as constructive as the last 
one.  The intention here is to solve a problem, not to bikeshed.

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

If puns were deli meat, this would be the wurst.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/distutils-sig/attachments/20090313/9bbcb0fd/attachment-0001.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: python-2.4-distutils-bdist_rpm-rpmversion-lexicalorder.patch
Type: text/x-patch
Size: 2511 bytes
Desc: not available
URL: <http://mail.python.org/pipermail/distutils-sig/attachments/20090313/9bbcb0fd/attachment-0001.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part.
URL: <http://mail.python.org/pipermail/distutils-sig/attachments/20090313/9bbcb0fd/attachment-0001.pgp>

More information about the Distutils-SIG mailing list