bug-gnulib
[Top][All Lists]
Advanced

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

Re: maint.mk syntax-check


From: Jim Meyering
Subject: Re: maint.mk syntax-check
Date: Tue, 12 Jan 2010 20:04:19 +0100

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




reply via email to

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