bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: abbreviating gnulib-generated "make" output


From: Bruno Haible
Subject: Re: abbreviating gnulib-generated "make" output
Date: Sat, 22 Aug 2009 12:56:50 +0200
User-agent: KMail/1.9.9

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

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 address@hidden 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 address@hidden $@ && \
        cp $(srcdir)/se-selinux.in.h address@hidden && \
        chmod a-x address@hidden && \
        mv address@hidden $@

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  <address@hidden>

        * 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 address@hidden $@ && \
-       cp $(srcdir)/se-selinux.in.h address@hidden && \
+       { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */' && \
+         cat $(srcdir)/se-selinux.in.h address@hidden; \
+       } > address@hidden && \
        chmod a-x address@hidden && \
        mv address@hidden $@
 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 address@hidden $@ && \
-       cp $(srcdir)/se-context.in.h address@hidden && \
+       { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */' && \
+         cat $(srcdir)/se-context.in.h address@hidden; \
+       } > address@hidden && \
        chmod a-x address@hidden && \
        mv address@hidden $@
 MOSTLYCLEANFILES += selinux/context.h selinux/context.h-t




reply via email to

[Prev in Thread] Current Thread [Next in Thread]