Jim Meyering <j...@meyering.net> writes: > Simon Josefsson wrote: >> It would be useful to have 'syntax-check' never check certain >> files/directories. This patch makes it possible to set VC_LIST_NEVER in >> cfg.mk. Objections to pushing? >> >> /Simon >> >> 2010-01-12 Simon Josefsson <si...@josefsson.org> >> >> * top/maint.mk (VC_LIST_EXCEPT): Filter list through VC_LIST_NEVER >> regexp too. >> >> diff --git a/top/maint.mk b/top/maint.mk >> index 3651543..c91b730 100644 >> --- a/top/maint.mk >> +++ b/top/maint.mk >> @@ -38,7 +38,9 @@ VC_LIST = $(build_aux)/vc-list-files -C $(srcdir) >> >> VC_LIST_EXCEPT = \ >> $(VC_LIST) | if test -f $(srcdir)/.x-$@; then grep -vEf $(srcdir)/.x-$@; \ >> - else grep -Ev "$${VC_LIST_EXCEPT_DEFAULT-ChangeLog}"; fi >> + else grep -Ev "$${VC_LIST_EXCEPT_DEFAULT-ChangeLog}"; fi \ >> + | if test -n "$(VC_LIST_NEVER)"; then grep -Ev "$(VC_LIST_NEVER)"; \ >> + else cat; fi > > Hi Simon, > > That's fine by me, but how about using a name/initialization like this: > > VC_LIST_ALWAYS_EXCLUDE_REGEX ?= ^$$ > > Then you can add a comment explaining that it's overridable > via cfg.mk, and how/when it's useful. In addition, the use > becomes simpler (no need for "if" + cat): > > | grep -Ev '$(VC_LIST_ALWAYS_EXCLUDE_REGEX)'; fi > > And note the single quotes, not double. > Hmm.. I've just realized we should use grep's -e option, > so that the customizable regex can start with "-": > > | grep -Ev -e '$(VC_LIST_ALWAYS_EXCLUDE_REGEX)'; fi > > at which point, it'd make sense to add -e to the preceding > use of grep, too.
Good ideas, I have pushed this. /Simon >From fa5fc15e75dc5af8bb1c5da3b362f10cf5aeca78 Mon Sep 17 00:00:00 2001 From: Simon Josefsson <si...@josefsson.org> Date: Tue, 12 Jan 2010 20:17:19 +0100 Subject: [PATCH] top/maint.mk (VC_LIST_EXCEPT): Filter list through VC_LIST_ALWAYS_EXCLUDE_REGEX. --- ChangeLog | 5 +++++ top/maint.mk | 7 ++++++- 2 files changed, 11 insertions(+), 1 deletions(-) diff --git a/ChangeLog b/ChangeLog index 8c6965c..d891134 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2010-01-12 Simon Josefsson <si...@josefsson.org> + + * top/maint.mk (VC_LIST_EXCEPT): Filter list through + VC_LIST_ALWAYS_EXCLUDE_REGEX. + 2010-01-12 Eric Blake <e...@byu.net> build: guarantee AS_VAR_IF diff --git a/top/maint.mk b/top/maint.mk index 3651543..366d12a 100644 --- a/top/maint.mk +++ b/top/maint.mk @@ -36,9 +36,14 @@ VC-tag = git tag -s -m '$(VERSION)' -u '$(gpg_key_ID)' VC_LIST = $(build_aux)/vc-list-files -C $(srcdir) +# You can override this variable in cfg.mk to set your own regexp +# matching files to ignore. +VC_LIST_ALWAYS_EXCLUDE_REGEX ?= ^$$ + VC_LIST_EXCEPT = \ $(VC_LIST) | if test -f $(srcdir)/.x-$@; then grep -vEf $(srcdir)/.x-$@; \ - else grep -Ev "$${VC_LIST_EXCEPT_DEFAULT-ChangeLog}"; fi + else grep -Ev -e "$${VC_LIST_EXCEPT_DEFAULT-ChangeLog}"; fi \ + | grep -Ev -e '$(VC_LIST_ALWAYS_EXCLUDE_REGEX)' ifeq ($(origin prev_version_file), undefined) prev_version_file = $(srcdir)/.prev-version -- 1.6.6