summaryrefslogtreecommitdiffstats
path: root/meta/files/toolchain-shar-relocate.sh
diff options
context:
space:
mode:
authorLiam R. Howlett <Liam.Howlett@windriver.com>2016-01-19 15:20:17 -0500
committerRichard Purdie <richard.purdie@linuxfoundation.org>2016-01-24 09:40:21 +0000
commit92abb5f1ceb24983c9e432013ee5c63daa461048 (patch)
tree4320748e92ab43a8221e1f69ff0580846c42bb95 /meta/files/toolchain-shar-relocate.sh
parent924e2c37a4a953fbf6c5125719aba01085c4de09 (diff)
downloadpoky-92abb5f1ceb24983c9e432013ee5c63daa461048.tar.gz
meta/files/toolchain-shar-relocate.sh: Detect different python binaries and select one that exists.
Although the relocate_sdk.sh supports python3, fc23 does not symlink /usr/bin/python3 to /usr/bin/python. Using exec instead of a call to the correct interpreter causes a failure on fc23 when python2 is not present. This uses 'which' to locate python, python2, then python3 and uses the first one that's found. (From OE-Core rev: 99d4d97f51b658d58a50789056b422e48df89ad9) Signed-off-by: Liam R. Howlett <Liam.Howlett@WindRiver.com> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/files/toolchain-shar-relocate.sh')
-rw-r--r--meta/files/toolchain-shar-relocate.sh19
1 files changed, 17 insertions, 2 deletions
diff --git a/meta/files/toolchain-shar-relocate.sh b/meta/files/toolchain-shar-relocate.sh
index 4ef2927171..4f34fb4bfb 100644
--- a/meta/files/toolchain-shar-relocate.sh
+++ b/meta/files/toolchain-shar-relocate.sh
@@ -13,8 +13,23 @@ if [ x$tdir = x ] ; then
13 echo "SDK relocate failed, could not create a temporary directory" 13 echo "SDK relocate failed, could not create a temporary directory"
14 exit 1 14 exit 1
15fi 15fi
16echo "#!/bin/bash" > $tdir/relocate_sdk.sh 16cat <<EOF >> $tdir/relocate_sdk.sh
17echo exec ${env_setup_script%/*}/relocate_sdk.py $target_sdk_dir $dl_path $executable_files >> $tdir/relocate_sdk.sh 17#!/bin/bash
18for py in python python2 python3
19do
20 PYTHON=\`which \${py} 2>/dev/null\`
21 if [ \$? -eq 0 ]; then
22 break;
23 fi
24done
25
26if [ x\${PYTHON} = "x" ]; then
27 echo "SDK could not be relocated. No python found."
28 exit 1
29fi
30\${PYTHON} ${env_setup_script%/*}/relocate_sdk.py $target_sdk_dir $dl_path $executable_files
31EOF
32
18$SUDO_EXEC mv $tdir/relocate_sdk.sh ${env_setup_script%/*}/relocate_sdk.sh 33$SUDO_EXEC mv $tdir/relocate_sdk.sh ${env_setup_script%/*}/relocate_sdk.sh
19$SUDO_EXEC chmod 755 ${env_setup_script%/*}/relocate_sdk.sh 34$SUDO_EXEC chmod 755 ${env_setup_script%/*}/relocate_sdk.sh
20rm -rf $tdir 35rm -rf $tdir