From 308bc9be7eeb56ed459c52b3870ceb5b80b1d9ba Mon Sep 17 00:00:00 2001 From: knarf Date: Mon, 1 Nov 2010 16:56:48 +0000 Subject: treat an exit status of 1 from GNU tar as success. This exit code is returned when some files changed while being compressed, but the whole archive is built at this point. This happens in Cactus while building, because reading the files for e.g. compiling changes their access-time, which is metadata of the files and is treated as file-change by tar. git-svn-id: http://svn.cactuscode.org/arrangements/CactusUtils/Formaline/trunk@191 83718e91-0e4f-0410-abf4-91180603181f --- src/make.configuration.deps | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/make.configuration.deps b/src/make.configuration.deps index dfb7d81..0f5c4c4 100644 --- a/src/make.configuration.deps +++ b/src/make.configuration.deps @@ -6,6 +6,11 @@ # Should we use gtar or tar? TAR := $(shell gtar --help > /dev/null 2> /dev/null && echo gtar || echo tar) +# Is this Gnu tar? If so, set this to 1, otherwise to 0 +# This is used to treat a exit code of 1 from gnu tar as non-fatal. This exit code +# indicates that files changed while reading, which can happen here because of changed +# atimes. +GNUTAR := $(shell $TAR --version 2>/dev/null | grep -q 'GNU tar' && echo "1" || echo "0") # Does tr support -C, or should we use -c instead? TR_C := $(shell tr -C 'a' 'b' < /dev/null > /dev/null 2> /dev/null && echo 'tr -C' || echo 'tr -c') @@ -122,7 +127,7 @@ $(TARBALL_DIR)/cactus-flesh-source.c: $(TARBALL_DIR)/cactus-flesh-source.tar.gz $(TARBALL_DIR)/cactus-flesh-source.tar.gz: $(TARBALL_DIR)/cactus-flesh-source.files cd $(CCTK_HOME) && \ - $(TAR) czf $@ -T $< + $(TAR) czf $@ -T $< || [ $[ $?/($GNUTAR+1) ] -eq 0 ] # This dependency means that the tarball for a thorn is only updated # if the thorn is actually recompiled. This does not catch changes to @@ -174,7 +179,7 @@ $(TARBALL_DIR)/cactus-thorn-source-%.c: $(TARBALL_DIR)/cactus-thorn-source-%.tar $(TARBALL_DIR)/cactus-thorn-source-%.tar.gz: $(TARBALL_DIR)/cactus-thorn-source-%.files cd $(CCTK_HOME) && \ - $(TAR) czf $@ -T $< + $(TAR) czf $@ -T $< || [ $[ $?/($GNUTAR+1) ] -eq 0 ] # This dependency means that the tarball for a thorn is only updated # if the thorn is actually recompiled. This does not catch changes to -- cgit v1.2.3