Patchwork [1/1] populate_sdk_base: fix bashism

login
register
mail settings
Submitter Laurentiu Palcu
Date July 4, 2013, 12:53 p.m.
Message ID <62b7cc36eab494ea6c7ece141b580132cb86e89a.1372942368.git.laurentiu.palcu@intel.com>
Download mbox | patch
Permalink /patch/52981/
State Accepted
Commit 6ac06a65ce52d4c123da53f115c84cb0a98bc18f
Headers show

Comments

Laurentiu Palcu - July 4, 2013, 12:53 p.m.
Only the printf bash builtin knows about %q format option for escaping
spaces. The coreutils version doesn't. Unfortunately, neither dash nor
sh have a printf builtin. So, escape the spaces using sed.

[YOCTO #4811]

Signed-off-by: Laurentiu Palcu <laurentiu.palcu@intel.com>
---
 meta/classes/populate_sdk_base.bbclass |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Patch

diff --git a/meta/classes/populate_sdk_base.bbclass b/meta/classes/populate_sdk_base.bbclass
index 31e848d..6378af9 100644
--- a/meta/classes/populate_sdk_base.bbclass
+++ b/meta/classes/populate_sdk_base.bbclass
@@ -181,7 +181,7 @@  else
 	echo "$target_sdk_dir"
 fi
 
-eval target_sdk_dir=$(printf "%q" "$target_sdk_dir")
+eval target_sdk_dir=$(echo "$target_sdk_dir"|sed 's/ /\\ /g')
 if [ -d "$target_sdk_dir" ]; then
 	target_sdk_dir=$(cd "$target_sdk_dir"; pwd)
 else