Makefile: remove mandatory "spatch" arguments from SPATCH_FLAGS
The "--patch ." part of SPATCH_FLAGS added inf57d11728d
(coccinelle: put sane filenames into output patches, 2018-07-23) should have been added unconditionally to the "spatch" invocation instead, using it isn't optional. Let's also move the other mandatory flag to come after $(SPATCH_FLAGS), to ensure that our "--sp-file" overrides any provided in the environment, both --sp-file <arg> and --patch <arg> are last-option-wins as far as spatch(1) option parsing is concerned. The environment variable override was initially added ina9a884aea5
(coccicheck: use --all-includes by default, 2016-09-30). In practice there's probably nobody that's using SPATCH_FLAGS to try to intentionally break our invocations, but since we're changing this let's make it clear what (if anything) we expect to be overridden by user-supplied flags. Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
parent
30cc8d0f14
commit
7b63ea5750
5
Makefile
5
Makefile
@ -1286,7 +1286,7 @@ SANITIZE_ADDRESS =
|
|||||||
# For the 'coccicheck' target; setting SPATCH_BATCH_SIZE higher will
|
# For the 'coccicheck' target; setting SPATCH_BATCH_SIZE higher will
|
||||||
# usually result in less CPU usage at the cost of higher peak memory.
|
# usually result in less CPU usage at the cost of higher peak memory.
|
||||||
# Setting it to 0 will feed all files in a single spatch invocation.
|
# Setting it to 0 will feed all files in a single spatch invocation.
|
||||||
SPATCH_FLAGS = --all-includes --patch .
|
SPATCH_FLAGS = --all-includes
|
||||||
SPATCH_BATCH_SIZE = 1
|
SPATCH_BATCH_SIZE = 1
|
||||||
|
|
||||||
include config.mak.uname
|
include config.mak.uname
|
||||||
@ -3131,7 +3131,8 @@ check: $(GENERATED_H)
|
|||||||
limit='-n $(SPATCH_BATCH_SIZE)'; \
|
limit='-n $(SPATCH_BATCH_SIZE)'; \
|
||||||
fi; \
|
fi; \
|
||||||
if ! echo $(COCCI_SOURCES) | xargs $$limit \
|
if ! echo $(COCCI_SOURCES) | xargs $$limit \
|
||||||
$(SPATCH) --sp-file $< $(SPATCH_FLAGS) \
|
$(SPATCH) $(SPATCH_FLAGS) \
|
||||||
|
--sp-file $< --patch . \
|
||||||
>$@+ 2>$@.log; \
|
>$@+ 2>$@.log; \
|
||||||
then \
|
then \
|
||||||
cat $@.log; \
|
cat $@.log; \
|
||||||
|
Loading…
Reference in New Issue
Block a user