On Wed, Oct 08, 2008 at 06:58:07PM +0100, Richard W.M. Jones wrote: > 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. Oh i see what you mean. ACK to this too. Daniel -- |: Red Hat, Engineering, London -o- http://people.redhat.com/berrange/ :| |: http://libvirt.org -o- http://virt-manager.org -o- http://ovirt.org :| |: http://autobuild.org -o- http://search.cpan.org/~danberr/ :| |: GnuPG: 7D3B9505 -o- F3C9 553F A1DA 4AC2 5648 23C1 B3DF F742 7D3B 9505 :| -- Libvir-list mailing list Libvir-list@xxxxxxxxxx https://www.redhat.com/mailman/listinfo/libvir-list