[Fedora-packaging] using the tilde in tarball versions

Toshio Kuratomi a.badger at gmail.com
Wed May 1 19:45:20 UTC 2013


On Wed, May 01, 2013 at 08:37:44PM +0200, Daniel Pocock wrote:
> On 01/05/13 19:39, Toshio Kuratomi wrote:
> >>
> > project-3.3.0-test1.tar.gz would also seem to work just as well and
> > additionally won't run into specialcases where people are using regexes to
> > parse version strings and they don't anticipate a tilde being used.
> 
> That seems problematic for various reasons:
> 
> - when I build a test rpm (which is one reason for the test tarball), it
> would end up with a name like project-3.3.0-test1-1.tar.gz
> 
Just noting that this is the tarball and has nothing to do with the rpm.

> - looking at this doc, it is not clear if it will take `3.3.0-test1' as
> the version, or if it will be `3.3.0' and release will be `test1':
> 
This is entirely up to you and your tooling. It has nothing to do with rpm.
rpm doesn't take a tarball name and decide how to break it up into name,
version, release on its own (and neither does dpkg).  That's something that
you decide when you write the spec file.

The best thing for your tooling to do is to break that up into:

version: 3.3.0
Release: 0.1.test1

To do this you can have your tooling split on "." and then compare the last
field to strings that you use to designate pre-releases.  When you get
matches, make the Release field for the rpm start with 0.1 (as opposed to 1
for regular releases) and append "." followed by the pre-release string.

> http://fedoraproject.org/wiki/Archive:Tools/RPM/VersionComparison
> 
> and in any case, 3.3.0-test1 > 3.3.0, while 3.3.0 = 3.3.0, so in no case
> can I see how to make a version that is < 3.3.0
> 
For the majority of tools out there, 3.3.0~test1 > 3.3.0 as well.  That's
why the advice is to set the Version field to the base version in the rpm
spec file (3.3.0) and use the Release: field to ensure proper ordering for
pre-releases.

> 
> > The tilde doesn't designate that general sorting algorithms will place the
> > filename before the base version in the general tools case.  It is only
> > special tools that recognize that usage.
> 
> Will the tools rpm and maybe yum behave the same way as dpkg does with
> tildes, at least on a very recent install such as F18 or F19?
> 

On Fedora 19 (I don't have F18 to check right now), rpm implements something
compatible with dpkg.  yum inherits the rpm vercmp so it should handle it
too.  Other tooling which doesn't use rpmvercmp directly won't.

> http://www.debian.org/doc/debian-policy/footnotes.html#f37
> 
> One of my aims with these tarballs is to verify that the final release
> will work smoothly with a wide range of packaging tools.
> 
If you want it to work with a wide range of packaging tools then you should
be using the Version + Release strategy to do pre-releases.  Otherwise you
will only work with newer versions of rpm; all current RHEL and other
derivatives, Fedora 17, OpenSuSE-12.2 and earlier, etc.


-Toshio
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: not available
URL: <http://lists.fedoraproject.org/pipermail/packaging/attachments/20130501/7fd583a3/attachment.sig>


More information about the packaging mailing list