Re: [PATCH] coccicheck: optionally batch spatch invocations
On Mon, May 6, 2019 at 7:55 PM Jeff King <peff@peff.net> wrote:
Show 24 quoted lines
> Here's what a patch might look like to implement "0". By still using
> xargs in the unlimited code path, it's not too bad. I dunno.
>
> ---
> diff --git a/Makefile b/Makefile
> index daba958b8f..0765a59b7a 100644
> --- a/Makefile
> +++ b/Makefile
> @@ -2792,7 +2792,12 @@ endif
>
> %.cocci.patch: %.cocci $(COCCI_SOURCES)
> @echo ' ' SPATCH $<; \
> - if ! echo $(COCCI_SOURCES) | xargs -n $(SPATCH_BATCH_SIZE) \
> + if test $(SPATCH_BATCH_SIZE) = 0; then \
> + limit=; \
> + else \
> + limit='-n $(SPATCH_BATCH_SIZE)'; \
> + fi; \
> + if ! echo $(COCCI_SOURCES) | xargs $$limit \
> $(SPATCH) --sp-file $< $(SPATCH_FLAGS) \
> >$@+ 2>$@.log; \
> then \
>
> -Peff
This doesn't seem too complicated to me..