From 8c35ba2d3048ce69f74f72cb2676e4bc162cfb63 Mon Sep 17 00:00:00 2001 From: Laurentiu Palcu Date: Tue, 25 Jun 2013 14:59:05 +0300 Subject: populate_sdk_base, adt_installer: abort install if path contains spaces Spaces are not handled properly in some parts of oe-core and it's safer to abort toolchain installation if path contains spaces. Even though we fix space handling in the toolchain installation script, there are various other parts in the toolchain (perl scripts, sysroot path passed to toolchain binaries, shebang lines) that would need special handling. So, for now, just bail out if path contains spaces. The checking for spaces in the path is done after expanding relative paths to absolute and tilde conversion. [YOCTO #4488] Signed-off-by: Laurentiu Palcu Signed-off-by: Richard Purdie --- meta/classes/populate_sdk_base.bbclass | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) (limited to 'meta/classes/populate_sdk_base.bbclass') diff --git a/meta/classes/populate_sdk_base.bbclass b/meta/classes/populate_sdk_base.bbclass index e5bc0b409d..31e848dd62 100644 --- a/meta/classes/populate_sdk_base.bbclass +++ b/meta/classes/populate_sdk_base.bbclass @@ -181,11 +181,16 @@ else echo "$target_sdk_dir" fi -eval target_sdk_dir=$target_sdk_dir -if [ -d $target_sdk_dir ]; then - target_sdk_dir=$(cd $target_sdk_dir; pwd) +eval target_sdk_dir=$(printf "%q" "$target_sdk_dir") +if [ -d "$target_sdk_dir" ]; then + target_sdk_dir=$(cd "$target_sdk_dir"; pwd) else - target_sdk_dir=$(readlink -m $target_sdk_dir) + target_sdk_dir=$(readlink -m "$target_sdk_dir") +fi + +if [ -n "$(echo $target_sdk_dir|grep ' ')" ]; then + echo "The target directory path ($target_sdk_dir) contains spaces. Abort!" + exit 1 fi if [ -e "$target_sdk_dir/environment-setup-${REAL_MULTIMACH_TARGET_SYS}" ]; then -- cgit 1.2.3-korg