On 17/08/15 13:32, Bernhard Voelker wrote:
> +# Ensure that non-trivial .x files in the 'man/' subdirectory,
> +# i.e., files exceeding a line count of 20 or a byte count of 1000,
> +# contain a Copyright notice.
> +.PHONY: sc_man_check_x_copyright
> +sc_man_check_x_copyright:
> +     @t=$@-t;                                                        \
> +     cd $(srcdir) && wc -cl man/*.x | head -n-1                      \
> +       | awk '$$1 >= 20 || $$2 >= 1000 {print $$3}'                  \
> +       | $(ASSORT) > $$t;                                            \
> +     xargs grep -l 'Copyright .* Free Software Foundation' < $$t     \
> +       | $(ASSORT) -u | diff - $$t                                   \
> +       || { echo  1>&2 '$@: exceeding file size/line count limit'    \
> +               '- please add a copyright note'; rm $$t; exit 1; };   \
> +     rm $$t
> +

I see that `grep -L` is already used in maint.mk, and is widely
available as FreeBSD and OS X use GNU grep or a compat replacement.
Therefore it could be simplified to avoid temp files like:

  awk ... | xargs grep -L 'Copy...' | grep . && { echo err; exit 1; }

cheers,
Pádraig

Reply via email to