maint: make generated THANKS file read-only
authorJim Meyering <meyering@redhat.com>
Sun, 20 Nov 2011 20:33:48 +0000 (21:33 +0100)
committerJim Meyering <meyering@redhat.com>
Sun, 20 Nov 2011 22:30:25 +0000 (23:30 +0100)
* Makefile.am (THANKS): Make generated file read-only.

Makefile.am

index 716cbdd..b866cbb 100644 (file)
@@ -143,7 +143,7 @@ ASSORT = LC_ALL=C sort
 prologue = perl -ne '/^\#\#/ and exit; print' $(srcdir)/THANKS.in
 
 THANKS: THANKS.in Makefile.am .mailmap thanks-gen .version
-       $(AM_V_GEN)                                                     \
+       $(AM_V_GEN)rm -f $@-t $@;                                       \
        {                                                               \
          $(prologue); echo;                                            \
          { perl -ne '/^$$/.../^$$/ and print' $(srcdir)/THANKS.in      \
@@ -154,7 +154,7 @@ THANKS: THANKS.in Makefile.am .mailmap thanks-gen .version
            | LC_ALL=en_US.UTF-8 sort -f;                               \
          echo;                                                         \
          printf ';; %s\n' 'Local Variables:' 'coding: utf-8' End:;     \
-       } > $@-t && mv $@-t $@
+       } > $@-t && chmod a-w $@-t && mv $@-t $@
 
 # Some of our git hook scripts are supposed to be identical to git's samples.
 # See if they are still in sync.