Project Info Name.......: gnu-hello
Description: GNU Hello


gnu-hello       
Info
Commit...:2341649dda6c2217e9c6a4588120645594890faf
Author...:Jim Meyering
Committer:Jim Meyering
Date.....:Thu Mar 13 09:06:30 2014 -0700
Parents..:f95bae73b472d2f0d725b86f7243c9efd073bdc0

Message
build: do not fail due to an existing read-only hello.1

* Makefile.am (hello.1): In Makefile rules, never redirect directly
to the target.  Instead, redirect to a temporary, $@-t, and once
that succeeds, rename to target using "mv -f".
Also, since this is a generated file, explicitly make it read-only,
so one is less likely to think it is an editable primary source.
Reported by Assaf Gordon.

Changes
diff --git a/Makefile.am b/Makefile.am
line changes: +3/-1
index 14aa203..eb02a4c
--- a/Makefile.am
+++ b/Makefile.am
@@ -48,7 +48,9 @@ EXTRA_DIST += $(man_MANS)
 CLEANFILES = $(man_MANS)
 
 hello.1: hello
-	$(HELP2MAN) --include=$(top_srcdir)/man/hello.x $(top_builddir)/hello -o $@
+	$(HELP2MAN) --include=$(top_srcdir)/man/hello.x $(top_builddir)/hello -o $@-t
+	chmod a=r $@-t
+	mv -f $@-t $@
 
 TESTS = \
 	tests/greeting-1 \

This website is licensed under AGPL-3.0. Feel free to copy!