[LEDE-DEV] [PATCH] Use printf instead of echo.

Felix Fietkau nbd at nbd.name
Tue Aug 23 02:21:34 PDT 2016


On 2016-08-23 10:02, Ash Benz wrote:
>  On some systems the shell built-in echo is used while on others /bin/echo and those two are not
>  identical; this causes incomplete .cflags generation on some systems.
> 
> Signed-off-by: Ash Benz <ash.benz at bk.ru>
> ---
>  package/network/services/hostapd/patches/200-multicall.patch | 8 ++++----
>  1 file changed, 4 insertions(+), 4 deletions(-)
> 
> diff --git a/package/network/services/hostapd/patches/200-multicall.patch b/package/network/services/hostapd/patches/200-multicall.patch
> index 8b260c2..ddfec6e 100644
> --- a/package/network/services/hostapd/patches/200-multicall.patch
> +++ b/package/network/services/hostapd/patches/200-multicall.patch
> @@ -54,10 +54,10 @@
>   endif
>   
>  +dump_cflags:
> -+	@echo -n $(CFLAGS) " "
> ++	@printf "%s " $(CFLAGS)
>  +
>  +dump_ldflags:
> -+	@echo -n $(LDFLAGS) $(LIBS) $(EXTRALIBS) " "
> ++	@printf "%s " $(LDFLAGS) $(LIBS) $(EXTRALIBS)
>  +
>   nt_password_hash: $(NOBJS)
>   	$(Q)$(CC) $(LDFLAGS) -o nt_password_hash $(NOBJS) $(LIBS_n)
> @@ -142,10 +142,10 @@
>   	@$(E) "  sed" $<
>   
>  +dump_cflags:
> -+	@echo -n $(CFLAGS) " "
> ++	@printf "%s " $(CFLAGS)
>  +
>  +dump_ldflags:
> -+	@echo -n $(LDFLAGS) $(LIBS) $(EXTRALIBS) " "
> ++	@printf "%s " $(LDFLAGS) $(LIBS) $(EXTRALIBS)
While your version appears to work, I think it would be more correct to
put everything in one argument for %s.
Please use something like:
	@printf "%s " "$(LDFLAGS) $(LIBS) $(EXTRALIBS)"

- Felix




More information about the Lede-dev mailing list