diff options
-rw-r--r-- | meta/files/toolchain-shar-relocate.sh | 19 |
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 |
15 | fi | 15 | fi |
16 | echo "#!/bin/bash" > $tdir/relocate_sdk.sh | 16 | cat <<EOF >> $tdir/relocate_sdk.sh |
17 | echo exec ${env_setup_script%/*}/relocate_sdk.py $target_sdk_dir $dl_path $executable_files >> $tdir/relocate_sdk.sh | 17 | #!/bin/bash |
18 | for py in python python2 python3 | ||
19 | do | ||
20 | PYTHON=\`which \${py} 2>/dev/null\` | ||
21 | if [ \$? -eq 0 ]; then | ||
22 | break; | ||
23 | fi | ||
24 | done | ||
25 | |||
26 | if [ x\${PYTHON} = "x" ]; then | ||
27 | echo "SDK could not be relocated. No python found." | ||
28 | exit 1 | ||
29 | fi | ||
30 | \${PYTHON} ${env_setup_script%/*}/relocate_sdk.py $target_sdk_dir $dl_path $executable_files | ||
31 | EOF | ||
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 |
20 | rm -rf $tdir | 35 | rm -rf $tdir |