]> code.ossystems Code Review - openembedded-core.git/commitdiff
populate_sdk_base, adt_installer: abort install if path contains spaces
authorLaurentiu Palcu <laurentiu.palcu@intel.com>
Tue, 25 Jun 2013 11:59:05 +0000 (14:59 +0300)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Tue, 25 Jun 2013 16:59:13 +0000 (17:59 +0100)
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 <laurentiu.palcu@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
meta/classes/populate_sdk_base.bbclass
meta/recipes-devtools/installer/adt-installer/adt_installer

index e5bc0b409d0ea84211962c6dc72b90ff18ac9bb9..31e848dd62f2bdd51c85743486269f07c59e2c15 100644 (file)
@@ -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
index c0123913ef654228a4c25444a5c32d95db15a61f..58728afd63abd5a6189ac790ac4f3c10800afcf9 100755 (executable)
@@ -339,11 +339,16 @@ if [ "$INSTALL_FOLDER" = "" ]; then
     INSTALL_FOLDER=$DEFAULT_INSTALL_FOLDER
 fi
 
-eval INSTALL_FOLDER=$INSTALL_FOLDER
-if [ -d $INSTALL_FOLDER ]; then
-       export INSTALL_FOLDER=$(cd $INSTALL_FOLDER; pwd)
+eval INSTALL_FOLDER=$(printf "%q" "$INSTALL_FOLDER")
+if [ -d "$INSTALL_FOLDER" ]; then
+       export INSTALL_FOLDER=$(cd "$INSTALL_FOLDER"; pwd)
 else
-       export INSTALL_FOLDER=$(readlink -m $INSTALL_FOLDER)
+       export INSTALL_FOLDER=$(readlink -m "$INSTALL_FOLDER")
+fi
+
+if [ -n "$(echo $INSTALL_FOLDER|grep ' ')" ]; then
+       echo "The target directory path ($INSTALL_FOLDER) contains spaces. Abort!"
+       exit 1
 fi
 
 clear