[PATCH] Makefile: avoid non-standard sed expressions

Marek Vasut marex at denx.de
Wed Nov 27 00:41:15 CET 2024


On 11/26/24 8:12 PM, Mark Kettenis wrote:
> The '?' that is used in the sed expression that determines MK_ARCH
> is part of the extended regular expression syntax, but the default
> behaviour of sed as specified by POSIX is to use only basic regular
> expression syntax.  Use the equivalent '\{0,1\}' instead as
> suggested by the OpenBSD re_format(7) man page.
> 
> Fixes: 04b1d84221d5 ("Makefile: fix empty MK_ARCH when using ccache")
> Signed-off-by: Mark Kettenis <kettenis at openbsd.org>
> ---
>   Makefile | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/Makefile b/Makefile
> index 22953bdabd8..7933ade6eff 100644
> --- a/Makefile
> +++ b/Makefile
> @@ -21,7 +21,7 @@ include include/host_arch.h
>   ifeq ("", "$(CROSS_COMPILE)")
>     MK_ARCH="${shell uname -m}"
>   else
> -  MK_ARCH="${shell echo $(CROSS_COMPILE) | sed -n 's/^\(ccache\)\?[[:space:]]*\([^\/]*\/\)*\([^-]*\)-[^[:space:]]*/\3/p'}"
> +  MK_ARCH="${shell echo $(CROSS_COMPILE) | sed -n 's/^\(ccache\)\{0,1\}[[:space:]]*\([^\/]*\/\)*\([^-]*\)-[^[:space:]]*/\3/p'}"
Interesting, and noted too, thanks.

Reviewed-by: Marek Vasut <marex at denx.de>


More information about the U-Boot mailing list