[OE-core] [dylan, master][PATCH] populate_sdk_base: Fix relocate_sdk.py execution on Arch

Richard Tollerton rich.tollerton at ni.com
Wed Oct 2 23:18:01 UTC 2013


relocate_sdk.py is #!/usr/bin/env python, but is not python3-compatible.
The PEP 394 alias `python2` is sadly not universally supported, so
instead of modifying relocate_sdk.py directly, change the `exec` in
relocate_sdk.sh to use it if it exists.

Signed-off-by: Richard Tollerton <rich.tollerton at ni.com>
---
 meta/classes/populate_sdk_base.bbclass | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/meta/classes/populate_sdk_base.bbclass b/meta/classes/populate_sdk_base.bbclass
index e5bc0b4..e67d8b6 100644
--- a/meta/classes/populate_sdk_base.bbclass
+++ b/meta/classes/populate_sdk_base.bbclass
@@ -256,8 +256,9 @@ if [ x$tdir = x ] ; then
    echo "SDK relocate failed, could not create a temporary directory"
    exit 1
 fi
+python_bin="$(command -v python2 2>/dev/null)" || python_bin=python
 echo "#!/bin/bash" > $tdir/relocate_sdk.sh
-echo exec ${env_setup_script%/*}/relocate_sdk.py $target_sdk_dir $dl_path $executable_files >> $tdir/relocate_sdk.sh
+echo exec $python_bin ${env_setup_script%/*}/relocate_sdk.py $target_sdk_dir $dl_path $executable_files >> $tdir/relocate_sdk.sh
 $SUDO_EXEC mv $tdir/relocate_sdk.sh ${env_setup_script%/*}/relocate_sdk.sh
 $SUDO_EXEC chmod 755 ${env_setup_script%/*}/relocate_sdk.sh
 rm -rf $tdir
-- 
1.8.4




More information about the Openembedded-core mailing list