From a3c5ca5741e0db9cbe635ba67d609a2f5c961773 Mon Sep 17 00:00:00 2001 From: Klaus Wenninger Date: Thu, 18 Nov 2021 14:19:27 +0100 Subject: [PATCH] Fix: build: never reuse existing tar-file if building modified commit --- rpm/Makefile.am | 23 +++++++++++------------ 1 file changed, 11 insertions(+), 12 deletions(-) diff --git a/rpm/Makefile.am b/rpm/Makefile.am index dbc6a6e47ac..a901d3f1941 100644 --- a/rpm/Makefile.am +++ b/rpm/Makefile.am @@ -114,18 +114,17 @@ distdir = $(top_distdir)/rpm TARFILE = $(abs_builddir)/../$(top_distdir).tar.gz export: - if [ -f "$(TARFILE)" ]; then \ - echo "`date`: Using existing tarball: $(TARFILE)"; \ - else \ - cd $(abs_srcdir)/..; \ - if [ -n "$(DIRTY_EXT)" ]; then \ - git commit -m "DO-NOT-PUSH" -a; \ - git archive --prefix=$(top_distdir)/ -o "$(TARFILE)" HEAD^{tree}; \ - git reset --mixed HEAD^; \ - else \ - git archive --prefix=$(top_distdir)/ -o "$(TARFILE)" $(TAG)^{tree}; \ - fi; \ - echo "`date`: Rebuilt $(TARFILE)"; \ + cd $(abs_srcdir)/..; \ + if [ -n "$(DIRTY_EXT)" ]; then \ + git commit -m "DO-NOT-PUSH" -a; \ + git archive --prefix=$(top_distdir)/ -o "$(TARFILE)" HEAD^{tree}; \ + git reset --mixed HEAD^; \ + echo "`date`: Rebuilt $(TARFILE)"; \ + elif [ -f "$(TARFILE)" ]; then \ + echo "`date`: Using existing tarball: $(TARFILE)"; \ + else \ + git archive --prefix=$(top_distdir)/ -o "$(TARFILE)" $(TAG)^{tree}; \ + echo "`date`: Rebuilt $(TARFILE)"; \ fi # Depend on spec-clean so the spec gets rebuilt every time