aboutsummaryrefslogtreecommitdiffstats
path: root/scripts
diff options
context:
space:
mode:
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/relocate_sdk.py17
1 files changed, 9 insertions, 8 deletions
diff --git a/scripts/relocate_sdk.py b/scripts/relocate_sdk.py
index c752fa2c61..0d5a6f5161 100755
--- a/scripts/relocate_sdk.py
+++ b/scripts/relocate_sdk.py
@@ -38,8 +38,6 @@ 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)
@@ -212,19 +210,22 @@ def change_dl_sysdirs(elf_file_name):
f.write(sysdirslen)
# MAIN
-if len(sys.argv) < 4:
+if len(sys.argv) < 5:
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[1]
- new_dl_path = sys.argv[2]
+ new_prefix = sys.argv[2]
+ new_dl_path = sys.argv[3]
else:
- new_prefix = sys.argv[1].encode()
- new_dl_path = sys.argv[2].encode()
+ new_prefix = sys.argv[2].encode()
+ new_dl_path = sys.argv[3].encode()
+
+executables_list = sys.argv[4:]
-executables_list = sys.argv[3:]
+old_prefix_ne = b(sys.argv[1])
+old_prefix = re.compile(re.escape(old_prefix_ne));
for e in executables_list:
perms = os.stat(e)[stat.ST_MODE]