[ELDK] [PATCH] eldk-switch.sh: Handle empty lines in environment script

Thomas Lange thomas at corelatus.se
Fri Feb 12 09:54:43 CET 2016


ELDK v5.8 includes an empty line in environment-setup-*
which caused this:

  k33:~$ eval `eldk-switch.sh -r 5.8 armv7a-hf`
  Setup for armv7a-hf (using ELDK 5.8)
  bash: syntax error near unexpected token `;'

So remove all empty lines before substituting <newline> with ;

Signed-off-by: Thomas Lange <thomas at corelatus.se>
---
 eldk-switch.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/eldk-switch.sh b/eldk-switch.sh
index dcdc193..252065a 100755
--- a/eldk-switch.sh
+++ b/eldk-switch.sh
@@ -346,7 +346,7 @@ else
 	# Use our pruned path to add the new path in our environment
 	pathcmd=$(cat ${config} | grep " PATH=")
 	eval $pathcmd
-	cmds=$(cat ${config} | grep -v " PATH=" | sed 's/$/ ; /g')
+	cmds=$(cat ${config} | grep -v " PATH=" | sed '/^$/d; s/$/ ; /g')
 	# We want to reference ${TARGET_PREFIX}, so evaluate it
 	eval $(cat ${config} | grep "TARGET_PREFIX=")
 	# Built minimal set of variables, i.e. PATH, CROSS_COMPILE and ARCH
-- 
2.1.4



More information about the eldk mailing list