From 1f6cc5a565e5380a2a5ba4e14597035b83f9bbc1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jaroslav=20=C5=A0karvada?= Date: Fri, 26 Jun 2015 15:03:34 +0200 Subject: [PATCH] Makefile: added 'tidy-mock-result-dir' target, it is requisite for 'nightly' MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This target will remove all RPMs older than cca. one week if the total space occupied by RPMs is larger than 5 MB. Signed-off-by: Jaroslav Škarvada --- Makefile | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index a133568..9d46479 100644 --- a/Makefile +++ b/Makefile @@ -60,6 +60,12 @@ clean-mock-result-dir: mock-result-dir: mkdir mock-result-dir +# delete RPM files older than cca. one week if total space occupied is more than 5 MB +tidy-mock-result-dir: mock-result-dir + if [ `du -bs mock-result-dir | tail -n 1 | cut -f1` -gt 5000000 ]; then \ + rm -f `find mock-result-dir -name '*.rpm' -mtime +7`; \ + fi + mock-build: srpm mock -r $(MOCK_CONFIG) $(MOCK_ARGS) --resultdir=`pwd`/mock-result-dir `ls rpm-build-dir/*$(RPM_VERSION).*.src.rpm | head -n 1`&& \ rm -f mock-result-dir/*.log @@ -77,7 +83,7 @@ createrepo: mock-devel-build scratch-build: mock-devel-build brew build --scratch --nowait rhel-7.2-candidate `ls mock-result-dir/*$(GIT_DATE)git*.*.src.rpm | head -n 1` -nightly: createrepo scratch-build +nightly: tidy-mock-result-dir createrepo scratch-build rsync -ave ssh --delete --progress mock-result-dir/* jskarvad@fedorapeople.org:/home/fedora/jskarvad/public_html/tuned/devel/repo/ install-dirs: