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

Re: [libvirt] [PATCH 1/2] Update MinGW specfile



On Wed, Oct 08, 2008 at 06:15:59PM +0100, Daniel P. Berrange wrote:
> > Index: autobuild.sh
> > ===================================================================
> > RCS file: /data/cvs/libvirt/autobuild.sh,v
> > retrieving revision 1.11
> > diff -u -r1.11 autobuild.sh
> > --- autobuild.sh	5 Sep 2008 12:03:45 -0000	1.11
> > +++ autobuild.sh	8 Oct 2008 15:45:00 -0000
> > @@ -42,14 +42,14 @@
> >  rm -f *.tar.gz
> >  make dist
> >  
> > -if [ -f /usr/bin/rpmbuild ]; then
> > -  if [ -n "$AUTOBUILD_COUNTER" ]; then
> > -    EXTRA_RELEASE=".auto$AUTOBUILD_COUNTER"
> > -  else
> > -    NOW=`date +"%s"`
> > -    EXTRA_RELEASE=".$USER$NOW"
> > -  fi
> > +if [ -n "$AUTOBUILD_COUNTER" ]; then
> > +  EXTRA_RELEASE=".auto$AUTOBUILD_COUNTER"
> > +else
> > +  NOW=`date +"%s"`
> > +  EXTRA_RELEASE=".$USER$NOW"
> > +fi
> >  
> > +if [ -f /usr/bin/rpmbuild ]; then
> >    rpmbuild --nodeps \
> >       --define "extra_release $EXTRA_RELEASE" \
> >       --define "_sourcedir `pwd`" \
> > @@ -81,8 +81,10 @@
> >    #set -o pipefail
> >    #make check 2>&1 | tee "$RESULTS"
> >  
> > -  rpmbuild --nodeps \
> > -     --define "extra_release $EXTRA_RELEASE" \
> > -     --define "_sourcedir `pwd`" \
> > -     -ba --clean mingw-libvirt.spec
> > +  if [ -f /usr/bin/rpmbuild ]; then
> > +    rpmbuild --nodeps \
> > +       --define "extra_release $EXTRA_RELEASE" \
> > +       --define "_sourcedir `pwd`" \
> > +       -ba --clean mingw32-libvirt.spec
> > +  fi
> >  fi
> 
> This big refactoring doesn't seem to be rquired by the renaming
> of the specfile.

Right, so this also fixes two bugs in the autobuild script, which I
should have mentioned.

The first bug is that rpmbuild could be called if it's not present
because the second invocation of rpmbuild isn't defended by a test.

The second bug (of sorts, not really a bug) is that $EXTRA_RELEASE is
used later in the specfile, even though it is created only
conditionally earlier.  In practice this means if you comment out the
first rpmbuild block (eg. to make things go faster while testing) then
the second one will fail because $EXTRA_RELEASE isn't defined.
Therefore I moved the definition of $EXTRA_RELEASE out of the first
conditional block.

Rich.

-- 
Richard Jones, Emerging Technologies, Red Hat  http://et.redhat.com/~rjones
virt-top is 'top' for virtual machines.  Tiny program with many
powerful monitoring features, net stats, disk stats, logging, etc.
http://et.redhat.com/~rjones/virt-top


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