diff options
-rw-r--r-- | lib/am/texi-vers.am | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/lib/am/texi-vers.am b/lib/am/texi-vers.am index bddf3827d..e98bb8234 100644 --- a/lib/am/texi-vers.am +++ b/lib/am/texi-vers.am @@ -31,25 +31,25 @@ DIST_COMMON += %VTEXI% %STAMPVTI% ## %STAMPVTI% is distributed and %DIRSTAMP% isn't: a distributed file ## should never be dependent upon a non-distributed built file. ## Therefore we ensure that %DIRSTAMP% exists in the rule. +## Use cp + mv so that the update of %VTEXI% is atomic even if +## the source directory is on a different file system. ?DIRSTAMP? @test -f %DIRSTAMP% || $(MAKE) $(AM_MAKEFLAGS) %DIRSTAMP% @(dir=.; test -f ./%TEXI% || dir=$(srcdir); \ set `$(SHELL) %MDDIR%mdate-sh $$dir/%TEXI%`; \ echo "@set UPDATED $$1 $$2 $$3"; \ echo "@set UPDATED-MONTH $$2 $$3"; \ echo "@set EDITION $(VERSION)"; \ - echo "@set VERSION $(VERSION)") > %VTI%.tmp -## Use cp and rm here because some older "mv"s can't move across -## filesystems. Furthermore, GNU "mv" in the AmigaDOS environment -## can't handle this. - @cmp -s %VTI%.tmp %VTEXI% \ - || (echo "Updating %VTEXI%"; \ - cp %VTI%.tmp %VTEXI%) - -@rm -f %VTI%.tmp + echo "@set VERSION $(VERSION)") > %VTI%.tmp$$$$ && \ + (cmp -s %VTI%.tmp$$$$ %VTEXI% \ + || (echo "Updating %VTEXI%" && \ + cp %VTI%.tmp$$$$ %VTEXI%.tmp$$$$ && \ + mv %VTEXI%.tmp$$$$ %VTEXI%)) && \ + rm -f %VTI%.tmp$$$$ %VTEXI%.$$$$ @cp %VTEXI% $@ mostlyclean-am: mostlyclean-%VTI% mostlyclean-%VTI%: - -rm -f %VTI%.tmp + -rm -f %VTI%.tmp* %VTEXI%.tmp* maintainer-clean-am: maintainer-clean-%VTI% maintainer-clean-%VTI%: |