All of lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH] support/dependencies: add suggested regex to sanitize PATH variable
@ 2022-01-25 19:07 Colin Foster
  2022-07-26  9:30 ` Yann E. MORIN
  0 siblings, 1 reply; 2+ messages in thread
From: Colin Foster @ 2022-01-25 19:07 UTC (permalink / raw)
  To: buildroot

WSL typically has /mnt/c/Program Files/... in the PATH variable. The
suggested command will remove anything that has spaces in PATH, which
should probably be good enough for most users who see this error.

Signed-off-by: Colin Foster <colin.foster@in-advantage.com>
---
 support/dependencies/dependencies.sh | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/support/dependencies/dependencies.sh b/support/dependencies/dependencies.sh
index c604a9efcc..e49dfb84a5 100755
--- a/support/dependencies/dependencies.sh
+++ b/support/dependencies/dependencies.sh
@@ -41,7 +41,8 @@ case ":${PATH:-unset}:" in
 (*" "*|*"${TAB}"*|*"${NL}"*)
 	printf "\n"
 	printf "Your PATH contains spaces, TABs, and/or newline (\\\n) characters.\n"
-	printf "This doesn't work. Fix you PATH.\n"
+	printf "This doesn't work. Fix your PATH. You can try running:\n"
+	printf "export PATH=\$(echo \$PATH | grep -Po \"(?::|^)[^\ :]+(?=(?::|$))\" | tr -d '\\\n'; echo)\n"
 	exit 1
 	;;
 esac
-- 
2.25.1

_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [Buildroot] [PATCH] support/dependencies: add suggested regex to sanitize PATH variable
  2022-01-25 19:07 [Buildroot] [PATCH] support/dependencies: add suggested regex to sanitize PATH variable Colin Foster
@ 2022-07-26  9:30 ` Yann E. MORIN
  0 siblings, 0 replies; 2+ messages in thread
From: Yann E. MORIN @ 2022-07-26  9:30 UTC (permalink / raw)
  To: Colin Foster; +Cc: buildroot

Colin, All,

Sorry for the long delay in reviewing this change...

On 2022-01-25 11:07 -0800, Colin Foster spake thusly:
> WSL typically has /mnt/c/Program Files/... in the PATH variable. The
> suggested command will remove anything that has spaces in PATH, which
> should probably be good enough for most users who see this error.

We have many other sanity checks, like current directory in PATH or
LD_LIBRARYPATH, or Perl stuff, and so on, and we do not explain for
each of them how to solve the problem. Especially, the space-in-PATH
is relatively easy to fix.

We assume that the user is knowledgeable enough to fix those on their
own.

Regards,
Yann E. MORIN.

> Signed-off-by: Colin Foster <colin.foster@in-advantage.com>
> ---
>  support/dependencies/dependencies.sh | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/support/dependencies/dependencies.sh b/support/dependencies/dependencies.sh
> index c604a9efcc..e49dfb84a5 100755
> --- a/support/dependencies/dependencies.sh
> +++ b/support/dependencies/dependencies.sh
> @@ -41,7 +41,8 @@ case ":${PATH:-unset}:" in
>  (*" "*|*"${TAB}"*|*"${NL}"*)
>  	printf "\n"
>  	printf "Your PATH contains spaces, TABs, and/or newline (\\\n) characters.\n"
> -	printf "This doesn't work. Fix you PATH.\n"
> +	printf "This doesn't work. Fix your PATH. You can try running:\n"
> +	printf "export PATH=\$(echo \$PATH | grep -Po \"(?::|^)[^\ :]+(?=(?::|$))\" | tr -d '\\\n'; echo)\n"
>  	exit 1
>  	;;
>  esac
> -- 
> 2.25.1
> 
> _______________________________________________
> buildroot mailing list
> buildroot@buildroot.org
> https://lists.buildroot.org/mailman/listinfo/buildroot

-- 
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 561 099 427 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2022-07-26  9:30 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-01-25 19:07 [Buildroot] [PATCH] support/dependencies: add suggested regex to sanitize PATH variable Colin Foster
2022-07-26  9:30 ` Yann E. MORIN

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.