]> git.ipfire.org Git - thirdparty/coreutils.git/commitdiff
build: make generated man/*.1 files read-only
authorJim Meyering <meyering@redhat.com>
Sun, 31 May 2009 07:52:51 +0000 (09:52 +0200)
committerJim Meyering <meyering@redhat.com>
Tue, 2 Jun 2009 14:35:14 +0000 (16:35 +0200)
This should help people notice that they are generated.
Note: each file already has a comment to that effect from help2man.
* man/Makefile.am (.x.1): Make generated files read-only.
Also, don't redirect directly to the target, $@.

man/Makefile.am

index 906e80479a7c0c8c87a53e2fe5388fc864d21b16..ee16a3ff2eb5d2ded8007bef67e27cdfb34f0b15 100644 (file)
@@ -154,7 +154,7 @@ mapped_name = `echo $*|sed 's/^install$$/ginstall/; s/^test$$/[/'`
              'or inadequate' 1>&2                              \
            ;;                                                  \
          *)                                                    \
-           rm -f $@                                            \
+           rm -f $@ $@-t                                       \
            && {                                                \
                 rm -rf $t;                                     \
                 mkdir $t;                                      \
@@ -164,8 +164,11 @@ mapped_name = `echo $*|sed 's/^install$$/ginstall/; s/^test$$/[/'`
                     --include=$(srcdir)/$*.x                   \
                     --output=$t/$@ $t/$*;                      \
               }                                                \
-           && sed 's|$*\.td/||g' $t/$@ > $@                    \
-           && rm -rf $t ;;                                     \
+           && sed 's|$*\.td/||g' $t/$@ > $@-t                  \
+           && rm -rf $t                                        \
+           && chmod -w $@-t                                    \
+           && mv $@-t $@                                       \
+           ;;                                                  \
        esac
 
 distcheck-hook: check-x-vs-1 check-programs-vs-x