bug-gnulib
[Top][All Lists]
Advanced

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

Re: update-copyright local hook


From: Eric Blake
Subject: Re: update-copyright local hook
Date: Fri, 14 Aug 2009 15:48:12 +0000 (UTC)
User-agent: Loom/3.14 (http://gmane.org/)

Jim Meyering <jim <at> meyering.net> writes:

> 
> +# If you have an additional project-specific rule,
> +# define it in cfg.mk and set this variable to its name.
> +update-copyright-local ?=
> +
>  .PHONY: update-copyright
> -update-copyright:
> +update-copyright: $(update-copyright-local)

I'm wondering if making this a user-overridable variable is a bit overkill.  
After all, GNU make dependencies are additive (as long as only one rule 
exists), such that:

maint.mk
========
foo:
        rule

cfg.mk
======
foo: prereq

works to run prereq before rule during 'make foo'.

>  # Run this rule once per year (usually early in January)
>  # to update all FSF copyright year lists in your project.
>  update-copyright-exclude-regexp ?= (^|/)COPYING$$
...
>       grep -l -w Copyright $$($(VC_LIST_EXCEPT))              \
>         | grep -v -E '$(update-copyright-exclude-regexp)'     \

Hmm.  VC_LIST_EXCEPT excludes ChangeLog by default, but this is one case where 
we WANT ChangeLog's copyright updated along with everything else.  Also, I 
think we should be exempting all forms of COPYING (such as COPYING.LIB).  And 
the use of .x-update-copyright seems cleaner than trying to write a sane regexp 
replacement in update-copyright-exclude-regexp (after all, I just got that 
wrong in autoconf[1]).  Would it be better to just do the following patch?

[1] http://thread.gmane.org/gmane.comp.sysutils.autoconf.patches/6772/focus=6773


From: Eric Blake <address@hidden>
Date: Fri, 14 Aug 2009 09:40:53 -0600
Subject: [PATCH] maint.mk: simplify update-copyright rule

* top/maint.mk (update-copyright-local): Delete, and document how
to do it in cfg.mk instead.
(update-copyright-exclude-regexp): Delete, and document how to do
it in .x-update-copyright instead.
(update-copyright): Simplify, thanks to VC_LIST_EXCEPT.  Don't
exclude ChangeLog.

Signed-off-by: Eric Blake <address@hidden>
---
 ChangeLog    |   10 ++++++++++
 top/maint.mk |   15 +++++++--------
 2 files changed, 17 insertions(+), 8 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index ad1eb52..eb39db5 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,15 @@
 2009-08-14  Eric Blake  <address@hidden>

+       maint.mk: simplify update-copyright rule
+       * top/maint.mk (update-copyright-local): Delete, and document how
+       to do it in cfg.mk instead.
+       (update-copyright-exclude-regexp): Delete, and document how to do
+       it in .x-update-copyright instead.
+       (update-copyright): Simplify, thanks to VC_LIST_EXCEPT.  Don't
+       exclude ChangeLog.
+
+2009-08-14  Eric Blake  <address@hidden>
+
        doc: mention more functions added in cygwin 1.7.0
        * doc/posix-headers/limits.texi (limits.h): Update for recent
        cygwin additions.
diff --git a/top/maint.mk b/top/maint.mk
index a4ce064..2510c17 100644
--- a/top/maint.mk
+++ b/top/maint.mk
@@ -772,15 +772,14 @@ INDENT_SOURCES ?= $(C_SOURCES)
 indent:
        indent $(INDENT_SOURCES)

-# If you have an additional project-specific rule,
-# define it in cfg.mk and set this variable to its name.
-update-copyright-local ?=
-
 # Run this rule once per year (usually early in January)
 # to update all FSF copyright year lists in your project.
-update-copyright-exclude-regexp ?= (^|/)COPYING$$
+# If you have an additional project-specific rule,
+# add it in cfg.mk along with a line 'update-copyright: prereq'.
+# By default, exclude all variants of COPYING; you can also
+# add exemptions (such as ChangeLog..* for rotated change logs)
+# in the file .x-update-copyright.
 .PHONY: update-copyright
 update-copyright: $(update-copyright-local)
-       grep -l -w Copyright $$($(VC_LIST_EXCEPT))              \
-         | grep -v -E '$(update-copyright-exclude-regexp)'     \
-         | xargs $(build_aux)/$@
+       grep -l -w Copyright $$($(VC_LIST_EXCEPT)) ChangeLog    \
+         | grep -v COPYING | xargs $(build_aux)/$@
-- 
1.6.3.2







reply via email to

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