[Ovirt-devel] [PATCH] A few specfile tweaks

Hugh O. Brock hbrock at redhat.com
Fri May 2 15:05:50 UTC 2008


On Fri, May 02, 2008 at 03:55:56PM +0100, Daniel P. Berrange wrote:
> On Fri, May 02, 2008 at 10:40:50AM -0400, Hugh O. Brock wrote:
> > On Fri, May 02, 2008 at 03:31:44PM +0100, Daniel P. Berrange wrote:
> > > On Fri, May 02, 2008 at 10:19:24AM -0400, Chris Lalancette wrote:

> There is no linear increasing changeset number you can use with GIT really.
> 
> It is probably best to have the release number set at time of build rather
> than manually changed by commits. eg, when we add an automated build script
> I'd recommend the following be used in the autobuild.sh script:
> 
>   if [ -n "$AUTOBUILD_COUNTER" ]; then
>     EXTRA_RELEASE=".auto$AUTOBUILD_COUNTER"
>   else
>     NOW=`date +"%s"`
>     EXTRA_RELEASE=".$USER$NOW"
>   fi
>   rpmbuild --define "extra_release $EXTRA_RELEASE" \
>             -ta --clean foo.tar.gz
> 
> And in the specfile:
> 
>   %define _extra_release %{?dist:%{dist}}%{!?dist:%{?extra_release:%{extra_release}}}
>   Release: 0%{_extra_release}
> 
> So if a developer wanted to build an RPM from the current checkout just
> running 'autobuild.sh' would then 'do the right thing' and create a RPM
> with a release field newer than any previous build. And if the automated
> build runs, it'll get tagged with the build counter
> 

Yeah this is what I was thinking. Ian or Mo, can you make the above happen?

--Hugh




More information about the ovirt-devel mailing list