[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Re: Requirements gathering for new package source control

On Tuesday 10 June 2008 03:23:36 pm Jesse Keating wrote:
> On Tue, 2008-06-10 at 21:16 +0200, Christoph Höger wrote:
> > I just had another idea (correct me, when thats already possible -
> > again):
> > How about some kind of automagic spec file generation for the versioning
> > part? Some kind of every commit/branch gets its own Version header
> > generated, that would easily allow every possible assertion on how
> > versioning information shall be handled.
> This somewhat possible now, I think the kernel package has done
> something like this in the past.

Still does.

> It makes the spec file look like soup though


> and not very friendly to those that want to base their work off 
> your spec file outside our source control.

Despite the soup, we've tried to actually make it easy for people to do their 
own custom build, and they generally don't need to touch anything but 
one %define. Here's a chunk of what we've got:

# Polite request for people who spin their own kernel rpms:
# please modify the "buildid" define in a way that identifies
# that the kernel isn't the stock distribution kernel, for example,
# by setting the define to ".local" or ".bz123456"
#% define buildid .local

# fedora_build defines which build revision of this kernel version we're
# building. Rather than incrementing forever, as with the prior versioning
# setup, we set fedora_cvs_origin to the current cvs revision s/1.// of the
# kernel spec when the kernel is rebased, so fedora_build automatically
# works out to the offset from the rebase, so it doesn't get too ginormous.
%define fedora_cvs_origin 623
%define fedora_build %(R="$Revision: 1.682 $"; R="${R%% \$}"; R="${R##: 1.}"; 
expr $R - %{fedora_cvs_origin})

...and so on. The above two lines are certainly fugly, but in the end, do 
nothing more than some simple math to create an auto-incrementing number -- 
682 - 623 = 59, which leads to NVR kernel-2.6.26-0.59.rc5.git4.fc10.

> Personally I'd rather stay 
> away from source control magic making it's way into the specfiles.

Indeed, if SCM != CVS, that's gonna need an overhaul...

Jarod Wilson
jwilson redhat com

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]