-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 According to Eric Blake on 12/9/2009 10:56 AM: > Plus a useless use of cat, for a total of 3 processes? Come on, we can do > better than that. A single sed process is sufficient, by rephrasing the > problem (rather than what do we want to exclude, it should be what we want to > include). > > sed -n '/GL_LINK_WARNING/,$$ p' $(top_srcdir)/build-aux/link-warning.h > > $...@-t > > (with the address range terminator $ already escaped for Makefile.am)
Tested this, then pushed: - -- Don't work too hard, make some time for fun as well! Eric Blake e...@byu.net -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (Cygwin) Comment: Public key at home.comcast.net/~ericblake/eblake.gpg Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iEYEARECAAYFAksgdFUACgkQ84KuGfSFAYDDYQCgqtL7KiplHcpdjDkU0zNmOtOE gLEAoIn3KE1qGZC0HDgMN0PuHXfMBniM =MZ6a -----END PGP SIGNATURE-----
>From a7f94464817dcc9bf86761b6480149c9230128b2 Mon Sep 17 00:00:00 2001 From: Eric Blake <e...@byu.net> Date: Wed, 9 Dec 2009 16:11:27 -0700 Subject: [PATCH] link-warning: optimize generation Avoid a useless use of cat. * modules/link-warning (Makefile.am): Reduce process usage. Signed-off-by: Eric Blake <e...@byu.net> --- ChangeLog | 9 +++++++-- modules/link-warning | 5 ++--- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/ChangeLog b/ChangeLog index 01b91e4..6b592e4 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2009-12-09 Eric Blake <e...@byu.net> + + link-warning: optimize generation + * modules/link-warning (Makefile.am): Reduce process usage. + 2009-12-09 Bruno Haible <br...@clisp.org> * doc/posix-functions/unsetenv.texi: Mention Solaris 10 bug for which a diff --git a/modules/link-warning b/modules/link-warning index 970ad55..daf3d47 100644 --- a/modules/link-warning +++ b/modules/link-warning @@ -14,9 +14,8 @@ BUILT_SOURCES += link-warning.h # build-aux/link-warning.h, except that it has the copyright header cut off. link-warning.h: $(top_srcdir)/build-aux/link-warning.h $(AM_V_GEN)rm -f $...@-t $@ && \ - cat $(top_srcdir)/build-aux/link-warning.h \ - | sed -e '1,/www\.gnu\.org\/licenses/d' | sed -e '1d' \ - > $...@-t && \ + sed -n '/GL_LINK_WARNING/,$$p' \ + $(top_srcdir)/build-aux/link-warning.h > $...@-t && \ mv $...@-t $@ MOSTLYCLEANFILES += link-warning.h link-warning.h-t -- 1.6.5.rc1