Jim Meyering wrote:
> I will follow up with a change to join the continued
> lines like this,
> 
> -     } > $...@-t && \
> -     mv $...@-t $@
> +     } > $...@-t && mv $...@-t $@

I will object this one, for legibility. 1 1/2 statements in one line, is
not good. Either multiple statements in a line, or multiple lines for one
statement, but not a mix of both.

> so that the conceptual redirect-to-$@ is performed all on one line.
> That way, it's less likely that someone will accidentally insert
> something between the redirect and the "mv".

There are already such statements between the creation of $...@-t and the 'mv',
in modules/selinux-h:

selinux/selinux.h: se-selinux.in.h
        $(AM_V_at)$(MKDIR_P) selinux
        $(AM_V_GEN)rm -f $...@-t $@ && \
        cp $(srcdir)/se-selinux.in.h $...@-t && \
        chmod a-x $...@-t && \
        mv $...@-t $@

I think this 'chmod a-x' command should be redundant. By the way, this 'cp'
is lacking the protection of generated .h files against accidental
modification that you insisted on for other files. How about this pstch?

Bruno


2009-08-22  Bruno Haible  <[email protected]>

        * modules/selinux-h (Makefile.am): Mark the two generated .h files as
        "generated automatically", protecting against accidental modification.

--- modules/selinux-h.orig      2009-08-22 12:54:12.000000000 +0200
+++ modules/selinux-h   2009-08-22 12:53:45.000000000 +0200
@@ -22,7 +22,9 @@
 selinux/selinux.h: se-selinux.in.h
        $(AM_V_at)$(MKDIR_P) selinux
        $(AM_V_GEN)rm -f $...@-t $@ && \
-       cp $(srcdir)/se-selinux.in.h $...@-t && \
+       { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */' && \
+         cat $(srcdir)/se-selinux.in.h $...@-t; \
+       } > $...@-t && \
        chmod a-x $...@-t && \
        mv $...@-t $@
 MOSTLYCLEANFILES += selinux/selinux.h selinux/selinux.h-t
@@ -31,7 +33,9 @@
 selinux/context.h: se-context.in.h
        $(AM_V_at)$(MKDIR_P) selinux
        $(AM_V_GEN)rm -f $...@-t $@ && \
-       cp $(srcdir)/se-context.in.h $...@-t && \
+       { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */' && \
+         cat $(srcdir)/se-context.in.h $...@-t; \
+       } > $...@-t && \
        chmod a-x $...@-t && \
        mv $...@-t $@
 MOSTLYCLEANFILES += selinux/context.h selinux/context.h-t


Reply via email to