[oe-commits] [openembedded-core] branch master updated: Revert "relocate_sdk.py: remove hardcoded SDK path"

git at git.openembedded.org git at git.openembedded.org
Wed Jul 25 15:47:13 UTC 2018


This is an automated email from the git hooks/post-receive script.

rpurdie pushed a commit to branch master
in repository openembedded-core.

The following commit(s) were added to refs/heads/master by this push:
     new b247392  Revert "relocate_sdk.py: remove hardcoded SDK path"
b247392 is described below

commit b247392b4ced57cfe694656032f6a6723740a9e8
Author: Richard Purdie <richard.purdie at linuxfoundation.org>
AuthorDate: Wed Jul 25 16:45:23 2018 +0100

    Revert "relocate_sdk.py: remove hardcoded SDK path"
    
    This reverts commit 6671a4d980c8bef8f402780a308f6c43a25044aa.
    
    This breaks uninative tarball since the call of relocate_sdk.py from uninative.bbclass
    wasn't updated to account for this change. It isn't clear what value that code could
    pass in and this isn't simple to fix so revert until a better fix can be found
    that doesn't break uninative.
    
    Signed-off-by: Richard Purdie <richard.purdie at linuxfoundation.org>
---
 meta/classes/populate_sdk_base.bbclass |  5 +++++
 meta/files/toolchain-shar-relocate.sh  |  2 +-
 scripts/relocate_sdk.py                | 17 ++++++++---------
 3 files changed, 14 insertions(+), 10 deletions(-)

diff --git a/meta/classes/populate_sdk_base.bbclass b/meta/classes/populate_sdk_base.bbclass
index e27ee03..7ffaf84 100644
--- a/meta/classes/populate_sdk_base.bbclass
+++ b/meta/classes/populate_sdk_base.bbclass
@@ -161,6 +161,11 @@ do_populate_sdk[stamp-extra-info] = "${MACHINE_ARCH}${SDKMACHINE}"
 
 fakeroot create_sdk_files() {
 	cp ${COREBASE}/scripts/relocate_sdk.py ${SDK_OUTPUT}/${SDKPATH}/
+
+	# Replace the ##DEFAULT_INSTALL_DIR## with the correct pattern.
+	# Escape special characters like '+' and '.' in the SDKPATH
+	escaped_sdkpath=$(echo ${SDKPATH} |sed -e "s:[\+\.]:\\\\\\\\\0:g")
+	sed -i -e "s:##DEFAULT_INSTALL_DIR##:$escaped_sdkpath:" ${SDK_OUTPUT}/${SDKPATH}/relocate_sdk.py
 }
 
 python check_sdk_sysroots() {
diff --git a/meta/files/toolchain-shar-relocate.sh b/meta/files/toolchain-shar-relocate.sh
index f82ff2b..e3c1001 100644
--- a/meta/files/toolchain-shar-relocate.sh
+++ b/meta/files/toolchain-shar-relocate.sh
@@ -36,7 +36,7 @@ if [ x\${PYTHON} = "x"  ]; then
 	echo "SDK could not be relocated.  No python found."
 	exit 1
 fi
-\${PYTHON} ${env_setup_script%/*}/relocate_sdk.py $DEFAULT_INSTALL_DIR $target_sdk_dir $dl_path $executable_files
+\${PYTHON} ${env_setup_script%/*}/relocate_sdk.py $target_sdk_dir $dl_path $executable_files
 EOF
 
 $SUDO_EXEC mv $tdir/relocate_sdk.sh ${env_setup_script%/*}/relocate_sdk.sh
diff --git a/scripts/relocate_sdk.py b/scripts/relocate_sdk.py
index 0d5a6f5..c752fa2 100755
--- a/scripts/relocate_sdk.py
+++ b/scripts/relocate_sdk.py
@@ -38,6 +38,8 @@ else:
     def b(x):
         return x.encode(sys.getfilesystemencoding())
 
+old_prefix = re.compile(b("##DEFAULT_INSTALL_DIR##"))
+
 def get_arch():
     f.seek(0)
     e_ident =f.read(16)
@@ -210,22 +212,19 @@ def change_dl_sysdirs(elf_file_name):
         f.write(sysdirslen)
 
 # MAIN
-if len(sys.argv) < 5:
+if len(sys.argv) < 4:
     sys.exit(-1)
 
 # In python > 3, strings may also contain Unicode characters. So, convert
 # them to bytes
 if sys.version_info < (3,):
-    new_prefix = sys.argv[2]
-    new_dl_path = sys.argv[3]
+    new_prefix = sys.argv[1]
+    new_dl_path = sys.argv[2]
 else:
-    new_prefix = sys.argv[2].encode()
-    new_dl_path = sys.argv[3].encode()
-
-executables_list = sys.argv[4:]
+    new_prefix = sys.argv[1].encode()
+    new_dl_path = sys.argv[2].encode()
 
-old_prefix_ne = b(sys.argv[1])
-old_prefix = re.compile(re.escape(old_prefix_ne));
+executables_list = sys.argv[3:]
 
 for e in executables_list:
     perms = os.stat(e)[stat.ST_MODE]

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the Openembedded-commits mailing list