* [Buildroot] [PATCH] support/dependencies: check PATH does not carry a \n
@ 2017-05-20 8:20 Yann E. MORIN
2017-06-08 19:42 ` Thomas Petazzoni
0 siblings, 1 reply; 2+ messages in thread
From: Yann E. MORIN @ 2017-05-20 8:20 UTC (permalink / raw)
To: buildroot
... otherwise it fails spectacularly as soon as PATH is referenced in a
package rule (i.e. very soon, fortunately):
>>> host-lzip 1.18 Downloading
/bin/bash: -c: line 0: unexpected EOF while looking for matching `"'
/bin/bash: -c: line 1: syntax error: unexpected end of file
Fixes # 9886.
Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
Cc: Ciro Santilli <ciro.santilli@gmail.com>
---
support/dependencies/dependencies.sh | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/support/dependencies/dependencies.sh b/support/dependencies/dependencies.sh
index 168d1960a1..925414cf18 100755
--- a/support/dependencies/dependencies.sh
+++ b/support/dependencies/dependencies.sh
@@ -29,6 +29,18 @@ if test -n "$LD_LIBRARY_PATH" ; then
fi
fi;
+# PATH should not contain a newline, otherwise it fails in spectacular ways
+# as soon as PATH is referenced in a package rule
+case "${PATH}" in
+(*"
+"*) printf "\n"
+ # Break the '\n' sequence, or a \n is printed (which is not what we want).
+ printf "Your PATH contains a newline (%sn) charater.\n" "\\"
+ printf "This doesn't work. Fix you PATH.\n"
+ exit 1
+ ;;
+esac
+
# sanity check for CWD in PATH. Having the current working directory
# in the PATH makes the toolchain build process break.
# try not to rely on egrep..
--
2.11.0
^ permalink raw reply related [flat|nested] 2+ messages in thread
* [Buildroot] [PATCH] support/dependencies: check PATH does not carry a \n
2017-05-20 8:20 [Buildroot] [PATCH] support/dependencies: check PATH does not carry a \n Yann E. MORIN
@ 2017-06-08 19:42 ` Thomas Petazzoni
0 siblings, 0 replies; 2+ messages in thread
From: Thomas Petazzoni @ 2017-06-08 19:42 UTC (permalink / raw)
To: buildroot
Hello,
On Sat, 20 May 2017 10:20:05 +0200, Yann E. MORIN wrote:
> + # Break the '\n' sequence, or a \n is printed (which is not what we want).
> + printf "Your PATH contains a newline (%sn) charater.\n" "\\"
Typo: character.
> + printf "This doesn't work. Fix you PATH.\n"
> + exit 1
> + ;;
Also, we use one tab for indentation in this file, not 4 spaces, so
I've fixed that.
Applied to master. Thanks!
Thomas
--
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2017-06-08 19:42 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-05-20 8:20 [Buildroot] [PATCH] support/dependencies: check PATH does not carry a \n Yann E. MORIN
2017-06-08 19:42 ` Thomas Petazzoni
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.