From: "João Henrique Ferreira de Freitas" <joaohf@gmail.com>
To: openembedded-core@lists.openembedded.org
Cc: otavio@ossystems.com.br
Subject: [PATCH v2 2/2] populate_sdk_base: ensure that filenames with empty space character are handled
Date: Mon, 14 Jul 2014 19:55:18 -0300 [thread overview]
Message-ID: <1405378518-4832-3-git-send-email-joaohf@gmail.com> (raw)
In-Reply-To: <1405378518-4832-1-git-send-email-joaohf@gmail.com>
When extracting toolchain, if the list $executable_files has filenames
with empty space character, the list will created but relocate_sdk.sh
will not handle it well. This will lead to the below erro:
./tmp/deploy/sdk/buildtools-mytools-x86_64-nativesdk-standalone-1.6.1.0.sh
Enter target directory for SDK (default: /opt/mydistro/mytoolset/1.6.1.0):
You are about to install the SDK to "/opt/mydistro/mytoolset/1.6.1.0". Proceed[Y/n]?
Extracting SDK...done
Setting it up.../opt/mydistro/mytoolset/1.6.1.0/relocate_sdk.sh: line 2: sintaxe error `token' `('
/opt/mydistro/mytoolset/1.6.1.0/relocate_sdk.sh: line 2: `e
The same occurs with replacement of ${SDKPATH} in configs/scripts/etc files.
We should ensure that full path is protected before relocate_sdk.sh
and ${SDKPATH} replacement calls.
Signed-off-by: João Henrique Ferreira de Freitas <joaohf@gmail.com>
---
meta/classes/populate_sdk_base.bbclass | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/meta/classes/populate_sdk_base.bbclass b/meta/classes/populate_sdk_base.bbclass
index a12bf11..a6e23a1 100644
--- a/meta/classes/populate_sdk_base.bbclass
+++ b/meta/classes/populate_sdk_base.bbclass
@@ -252,7 +252,7 @@ if [ "$dl_path" = "" ] ; then
echo "SDK could not be set up. Relocate script unable to find ld-linux.so. Abort!"
exit 1
fi
-executable_files=$($SUDO_EXEC find $native_sysroot -type f -perm /111)
+executable_files=$($SUDO_EXEC find $native_sysroot -type f -perm /111 -printf "'%h/%f' ")
tdir=`mktemp -d`
if [ x$tdir = x ] ; then
@@ -273,7 +273,7 @@ if [ $relocate = 1 ] ; then
fi
# replace ${SDKPATH} with the new prefix in all text files: configs/scripts/etc
-$SUDO_EXEC find $native_sysroot -type f -exec file '{}' \;|grep ":.*\(ASCII\|script\|source\).*text"|cut -d':' -f1|$SUDO_EXEC xargs sed -i -e "s:$DEFAULT_INSTALL_DIR:$target_sdk_dir:g"
+$SUDO_EXEC find $native_sysroot -type f -exec file '{}' \;|grep ":.*\(ASCII\|script\|source\).*text"|cut -d':' -f1|tr "\n" "\0"|$SUDO_EXEC xargs -0 sed -i -e "s:$DEFAULT_INSTALL_DIR:$target_sdk_dir:g"
# change all symlinks pointing to ${SDKPATH}
for l in $($SUDO_EXEC find $native_sysroot -type l); do
--
1.9.1
next prev parent reply other threads:[~2014-07-14 22:55 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-07-02 1:58 [PATCH 0/2] add nativesdk to BBCLASSEXTEND to python-distribute and to fix the side effect of it João Henrique Ferreira de Freitas
2014-07-02 1:58 ` [PATCH 1/2] python-distribute: add nativesdk to BBCLASSEXTEND João Henrique Ferreira de Freitas
2014-07-02 1:58 ` [PATCH 2/2] populate_sdk_base: ensure that filenames with empty space character are handled João Henrique Ferreira de Freitas
2014-07-09 0:19 ` Saul Wold
2014-07-09 1:33 ` Otavio Salvador
2014-07-12 13:20 ` João Henrique Ferreira de Freitas
2014-07-14 15:10 ` Otavio Salvador
2014-07-14 22:55 ` [PATCH v2 0/2] add nativesdk to BBCLASSEXTEND to python-distribute and to fix the side effect of it João Henrique Ferreira de Freitas
2014-07-14 22:55 ` [PATCH v2 1/2] python-distribute: add nativesdk to BBCLASSEXTEND João Henrique Ferreira de Freitas
2014-07-15 13:35 ` Otavio Salvador
2014-07-17 0:50 ` João Henrique Ferreira de Freitas
2014-07-17 11:33 ` Otavio Salvador
2014-07-14 22:55 ` João Henrique Ferreira de Freitas [this message]
2014-07-15 13:33 ` [PATCH v2 2/2] populate_sdk_base: ensure that filenames with empty space character are handled Otavio Salvador
2014-07-16 3:01 ` João Henrique Ferreira de Freitas
2014-07-18 3:09 ` [PATCH v3 0/2] add nativesdk to BBCLASSEXTEND to python-distribute and to fix the side effect of it João Henrique Ferreira de Freitas
2014-07-18 3:09 ` [PATCH v3 1/2] python-distribute: add nativesdk to BBCLASSEXTEND João Henrique Ferreira de Freitas
2014-07-18 3:09 ` [PATCH v3 2/2] populate_sdk_base: ensure that filenames with empty space character are handled João Henrique Ferreira de Freitas
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1405378518-4832-3-git-send-email-joaohf@gmail.com \
--to=joaohf@gmail.com \
--cc=openembedded-core@lists.openembedded.org \
--cc=otavio@ossystems.com.br \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox