[libvirt] [jenkins-ci PATCH] jobs: ensure rpmbuild purges $RPM-ROOT/BUILD/$PACKAGE

Daniel P. Berrangé posted 1 patch 5 years, 8 months ago
Failed in applying to current master (apply log)
jobs/autotools.yaml        | 2 +-
jobs/perl-modulebuild.yaml | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
[libvirt] [jenkins-ci PATCH] jobs: ensure rpmbuild purges $RPM-ROOT/BUILD/$PACKAGE
Posted by Daniel P. Berrangé 5 years, 8 months ago
When using 'rpmbuild --rebuild',  $RPM-ROOT/BUILD/$PACKAGE is
automatically deleted on completion, but when using 'rpmbuild --ta' it
is not deleted. We need to pass --clean to get the desired behaviour.

This was not a visible problem in the past because "git clean -fdx"
would purge the directory, but since we use %autosetup now the directory
will contain a git repo which causes "git clean" to skip deletion:

  $ su - jenkins
  $ cd libvirt-master
  $ git clean -fdx
  Skipping repository build/rpmbuild/BUILD/libvirt-4.7.0

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
---
 jobs/autotools.yaml        | 2 +-
 jobs/perl-modulebuild.yaml | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/jobs/autotools.yaml b/jobs/autotools.yaml
index c1d0f27..f1ebf7b 100644
--- a/jobs/autotools.yaml
+++ b/jobs/autotools.yaml
@@ -172,7 +172,7 @@
           sed -i -e 's/BuildRequires: pkgconfig(libvirt.*).*//' {name}.spec
           rm -f *.tar.{archive_format}
           $MAKE dist
-          rpmbuild --define "_topdir `pwd`/rpmbuild" -ta {name}-*.tar.{archive_format}
+          rpmbuild --clean --define "_topdir `pwd`/rpmbuild" -ta {name}-*.tar.{archive_format}
     publishers:
       - email:
           recipients: '{obj:spam}'
diff --git a/jobs/perl-modulebuild.yaml b/jobs/perl-modulebuild.yaml
index 934b216..3f3f537 100644
--- a/jobs/perl-modulebuild.yaml
+++ b/jobs/perl-modulebuild.yaml
@@ -126,7 +126,7 @@
           sed -i -e 's/BuildRequires: *libvirt.*devel.*//' *.spec
           rm -f *.tar.{archive_format}
           perl Build dist
-          rpmbuild --define "_topdir `pwd`/rpmbuild" -ta *.tar.{archive_format}
+          rpmbuild --clean --define "_topdir `pwd`/rpmbuild" -ta *.tar.{archive_format}
     publishers:
       - email:
           recipients: '{obj:spam}'
-- 
2.17.1

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list
Re: [libvirt] [jenkins-ci PATCH] jobs: ensure rpmbuild purges $RPM-ROOT/BUILD/$PACKAGE
Posted by Andrea Bolognani 5 years, 8 months ago
On Thu, 2018-08-09 at 12:02 +0100, Daniel P. Berrangé wrote:
> When using 'rpmbuild --rebuild',  $RPM-ROOT/BUILD/$PACKAGE is

s/  / /

> automatically deleted on completion, but when using 'rpmbuild --ta' it

s/--ta/-ta/

> is not deleted. We need to pass --clean to get the desired behaviour.
> 
> This was not a visible problem in the past because "git clean -fdx"
> would purge the directory, but since we use %autosetup now the directory

s/use %autosetup now/use %autosetup for libvirt now/

> will contain a git repo which causes "git clean" to skip deletion:
> 
>   $ su - jenkins
>   $ cd libvirt-master
>   $ git clean -fdx
>   Skipping repository build/rpmbuild/BUILD/libvirt-4.7.0
> 
> Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
> ---
>  jobs/autotools.yaml        | 2 +-
>  jobs/perl-modulebuild.yaml | 2 +-
>  2 files changed, 2 insertions(+), 2 deletions(-)

Reviewed-by: Andrea Bolognani <abologna@redhat.com>

-- 
Andrea Bolognani / Red Hat / Virtualization

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list