<div dir="ltr">BTW, buildbots are failing because of the change in git check prereq<div><a href="http://buildbot.openwrt.org:8010/builders/ath25/builds/168/steps/compile_1/logs/stdio">http://buildbot.openwrt.org:8010/builders/ath25/builds/168/steps/compile_1/logs/stdio</a><br></div><div><br></div></div><br><div class="gmail_quote"><div dir="ltr">Em sáb, 5 de mar de 2016 às 17:55, Luiz Angelo Daros de Luca <<a href="mailto:luizluca@gmail.com">luizluca@gmail.com</a>> escreveu:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">If a prereq-build command check defines a command env var (ex: MANPAGER=cat git ...)<br>
prereq SetupHostCommand breaks. This is because it looks for the binary using which on<br>
the first space-separated item (which might be the env var definition)<br>
<br>
This patch replaces bash substitution by a sed regex that removes both env parameters and<br>
command args.<br>
---<br>
 include/<a href="http://prereq.mk" rel="noreferrer" target="_blank">prereq.mk</a> | 5 ++++-<br>
 1 file changed, 4 insertions(+), 1 deletion(-)<br>
<br>
diff --git a/include/<a href="http://prereq.mk" rel="noreferrer" target="_blank">prereq.mk</a> b/include/<a href="http://prereq.mk" rel="noreferrer" target="_blank">prereq.mk</a><br>
index 6cb590e..839b663 100644<br>
--- a/include/<a href="http://prereq.mk" rel="noreferrer" target="_blank">prereq.mk</a><br>
+++ b/include/<a href="http://prereq.mk" rel="noreferrer" target="_blank">prereq.mk</a><br>
@@ -92,8 +92,11 @@ define SetupHostCommand<br>
                   $(call QuoteHostCommand,$(7)) $(call QuoteHostCommand,$(8)) \<br>
                           $(call QuoteHostCommand,$(9)); do \<br>
                if [ -n "$$$$$$$$cmd" ]; then \<br>
+                       regex_rm_vars='s/^(\w+=(\['\'\"]']|'\''[^'\'']*'\''|"[^"]*"|[^ ]*(\\ )?)* )*//'; \<br>
+                       regex_rm_args='s/[[:space:]].*//'; \<br>
+                       regex_clean_cmd="$$$$$$$$regex_rm_vars;$$$$$$$$regex_rm_args"; \<br>
                        bin="$$$$$$$$(PATH="$(subst $(space),:,$(filter-out $(STAGING_DIR_HOST)/%,$(subst :,$(space),$(PATH))))" \<br>
-                               which "$$$$$$$${cmd%% *}")"; \<br>
+                               which "$$$$$$$$(echo $$$$$$$$cmd | sed -re "$$$$$$$$regex_clean_cmd")")"; \<br>
                        if [ -x "$$$$$$$$bin" ] && eval "$$$$$$$$cmd" >/dev/null 2>/dev/null; then \<br>
                                mkdir -p "$(STAGING_DIR_HOST)/bin"; \<br>
                                ln -sf "$$$$$$$$bin" "$(STAGING_DIR_HOST)/bin/$(strip $(1))"; \<br>
--<br>
2.5.0<br>
<br>
</blockquote></div><div dir="ltr">-- <br></div><p dir="ltr">Luiz Angelo Daros de Luca<br>
<a href="mailto:luizluca@gmail.com">luizluca@gmail.com</a></p>