Message ID | 1457211294-26740-1-git-send-email-luizluca@gmail.com |
---|---|
State | Superseded |
Headers | show |
BTW, buildbots are failing because of the change in git check prereq http://buildbot.openwrt.org:8010/builders/ath25/builds/168/steps/compile_1/logs/stdio Em sáb, 5 de mar de 2016 às 17:55, Luiz Angelo Daros de Luca < luizluca@gmail.com> escreveu: > If a prereq-build command check defines a command env var (ex: > MANPAGER=cat git ...) > prereq SetupHostCommand breaks. This is because it looks for the binary > using which on > the first space-separated item (which might be the env var definition) > > This patch replaces bash substitution by a sed regex that removes both env > parameters and > command args. > --- > include/prereq.mk | 5 ++++- > 1 file changed, 4 insertions(+), 1 deletion(-) > > diff --git a/include/prereq.mk b/include/prereq.mk > index 6cb590e..839b663 100644 > --- a/include/prereq.mk > +++ b/include/prereq.mk > @@ -92,8 +92,11 @@ define SetupHostCommand > $(call QuoteHostCommand,$(7)) $(call > QuoteHostCommand,$(8)) \ > $(call QuoteHostCommand,$(9)); do \ > if [ -n "$$$$$$$$cmd" ]; then \ > + > regex_rm_vars='s/^(\w+=(\['\'\"]']|'\''[^'\'']*'\''|"[^"]*"|[^ ]*(\\ )?)* > )*//'; \ > + regex_rm_args='s/[[:space:]].*//'; \ > + > regex_clean_cmd="$$$$$$$$regex_rm_vars;$$$$$$$$regex_rm_args"; \ > bin="$$$$$$$$(PATH="$(subst > $(space),:,$(filter-out $(STAGING_DIR_HOST)/%,$(subst > :,$(space),$(PATH))))" \ > - which "$$$$$$$${cmd%% *}")"; \ > + which "$$$$$$$$(echo $$$$$$$$cmd | sed -re > "$$$$$$$$regex_clean_cmd")")"; \ > if [ -x "$$$$$$$$bin" ] && eval "$$$$$$$$cmd" > >/dev/null 2>/dev/null; then \ > mkdir -p "$(STAGING_DIR_HOST)/bin"; \ > ln -sf "$$$$$$$$bin" > "$(STAGING_DIR_HOST)/bin/$(strip $(1))"; \ > -- > 2.5.0 > > -- Luiz Angelo Daros de Luca luizluca@gmail.com
On 2016-03-05 21:56, Luiz Angelo Daros de Luca wrote: > BTW, buildbots are failing because of the change in git check prereq > http://buildbot.openwrt.org:8010/builders/ath25/builds/168/steps/compile_1/logs/stdio Fixed in r48934 - Felix
diff --git a/include/prereq.mk b/include/prereq.mk index 6cb590e..839b663 100644 --- a/include/prereq.mk +++ b/include/prereq.mk @@ -92,8 +92,11 @@ define SetupHostCommand $(call QuoteHostCommand,$(7)) $(call QuoteHostCommand,$(8)) \ $(call QuoteHostCommand,$(9)); do \ if [ -n "$$$$$$$$cmd" ]; then \ + regex_rm_vars='s/^(\w+=(\['\'\"]']|'\''[^'\'']*'\''|"[^"]*"|[^ ]*(\\ )?)* )*//'; \ + regex_rm_args='s/[[:space:]].*//'; \ + regex_clean_cmd="$$$$$$$$regex_rm_vars;$$$$$$$$regex_rm_args"; \ bin="$$$$$$$$(PATH="$(subst $(space),:,$(filter-out $(STAGING_DIR_HOST)/%,$(subst :,$(space),$(PATH))))" \ - which "$$$$$$$${cmd%% *}")"; \ + which "$$$$$$$$(echo $$$$$$$$cmd | sed -re "$$$$$$$$regex_clean_cmd")")"; \ if [ -x "$$$$$$$$bin" ] && eval "$$$$$$$$cmd" >/dev/null 2>/dev/null; then \ mkdir -p "$(STAGING_DIR_HOST)/bin"; \ ln -sf "$$$$$$$$bin" "$(STAGING_DIR_HOST)/bin/$(strip $(1))"; \