[OpenWrt-Devel] [PATCH] prereq: fixes checks that prefix env vars (ex:git)
Luiz Angelo Daros de Luca
luizluca at gmail.com
Sat Mar 5 15:56:36 EST 2016
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 at 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 at gmail.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.infradead.org/pipermail/openwrt-devel/attachments/20160305/0c35a344/attachment.htm>
-------------- next part --------------
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
More information about the openwrt-devel
mailing list