From eb5ec8899d41d2df7fb9d9918d2d93042a678d97 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] (From OE-Core master rev: 8c35ba2d3048ce69f74f72cb2676e4bc162cfb63) (From OE-Core rev: 407e57879ea2f931bff32993b850c9d59d228303) Signed-off-by: Laurentiu Palcu Signed-off-by: Richard Purdie --- meta/recipes-devtools/installer/adt-installer/adt_installer | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) (limited to 'meta/recipes-devtools') diff --git a/meta/recipes-devtools/installer/adt-installer/adt_installer b/meta/recipes-devtools/installer/adt-installer/adt_installer index c0123913ef..58728afd63 100755 --- a/meta/recipes-devtools/installer/adt-installer/adt_installer +++ b/meta/recipes-devtools/installer/adt-installer/adt_installer @@ -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 -- cgit v1.2.3-54-g00ecf