I've modified DISTTAG tag to be specified in macros file just like
DISTRIBUTION, VENDOR etc.
and commited it to CVS already.
Here's my next step, a DISTEPOCH tag where distribution version can be
added.

This will change EVR to EVRD which will be represented as
%{EPOCH}:%{VERSION}-%{RELEASE}:%{DISTEPOCH}, ie. 1:2.3.4-5:2009.1.
The distepoch tag will behave kinda like the epoch tag in the way that it's
optional, but
it's significance in version comparision will be the least.

ie. this way 1:2.3.4-5:2009.1 will be treated as newer than
1:2.3.4-5:2009.0, so this is
consistent with the behaviour of ie. %{_dist} in Fedora, or %mkrel in
Mandriva.

As you see from this, the distribution tag will be kept out of the actual
versioning,
while the distribution release will be moved to a new tag separately from
%RELEASE.

As the distrib tag is quite nice to have and all, it will still be part of
the package file name.
Consider the following ~/.rpmmacros:
%disttag           mdv
%distepoch      2009.0

This will create package with the following filename:
foo-2.3.4-5:mdv2009.0.x86_64.rpm

>From /usr/lib/rpm/macros:
%___NVRDA
%%{NAME}-%%{VERSION}-%%{RELEASE}%%|DISTTAG?{:%%{DISTTAG}%%|DISTEPOCH?{%%{DISTEPOCH}}|}|%%|ARCH?{.%%|SOURCERPM?{%%{ARCH}}:{src}|}:{}|
%_build_name_fmt    %%{ARCH}/%{___NVRDA}.rpm

Notice that package filename will only be changed to this new style if
%disttag & %distepoch is used,
otherwise old package file name is kept.

You can also use 'DistTag:' & 'DistEpoch:'  per package basis as with ie.
'Distribution:' etc.

This patch is quite non-intrusive and only of concern to anyone choosing to
use these tags,
otherwise you won't be affected by it. There's of course a lot of further
improvements that
can be made, but they're not that important initially.

So WDYT? I personally think this is a very nice solution curing the abuse of
%release for this
purpose while providing a standard way for these things as well.
I'll wait for some comments first in case of any objections before
commiting, meanwhile
you can find the patch here:
http://www.zarb.org/cgi-bin/viewvc.cgi/snapshot/rpm/current/SOURCES/rpm-5.2-distepoch.patch?root=rpm5distro&view=log

--
Regards,
Per Øyvind

Reply via email to