diff options
Diffstat (limited to 'scripts/relocate_sdk.py')
| -rwxr-xr-x | scripts/relocate_sdk.py | 17 | 
1 files changed, 8 insertions, 9 deletions
diff --git a/scripts/relocate_sdk.py b/scripts/relocate_sdk.py index 0d5a6f5161..c752fa2c61 100755 --- a/scripts/relocate_sdk.py +++ b/scripts/relocate_sdk.py  | |||
| @@ -38,6 +38,8 @@ else: | |||
| 38 | def b(x): | 38 | def b(x): | 
| 39 | return x.encode(sys.getfilesystemencoding()) | 39 | return x.encode(sys.getfilesystemencoding()) | 
| 40 | 40 | ||
| 41 | old_prefix = re.compile(b("##DEFAULT_INSTALL_DIR##")) | ||
| 42 | |||
| 41 | def get_arch(): | 43 | def get_arch(): | 
| 42 | f.seek(0) | 44 | f.seek(0) | 
| 43 | e_ident =f.read(16) | 45 | e_ident =f.read(16) | 
| @@ -210,22 +212,19 @@ def change_dl_sysdirs(elf_file_name): | |||
| 210 | f.write(sysdirslen) | 212 | f.write(sysdirslen) | 
| 211 | 213 | ||
| 212 | # MAIN | 214 | # MAIN | 
| 213 | if len(sys.argv) < 5: | 215 | if len(sys.argv) < 4: | 
| 214 | sys.exit(-1) | 216 | sys.exit(-1) | 
| 215 | 217 | ||
| 216 | # In python > 3, strings may also contain Unicode characters. So, convert | 218 | # In python > 3, strings may also contain Unicode characters. So, convert | 
| 217 | # them to bytes | 219 | # them to bytes | 
| 218 | if sys.version_info < (3,): | 220 | if sys.version_info < (3,): | 
| 219 | new_prefix = sys.argv[2] | 221 | new_prefix = sys.argv[1] | 
| 220 | new_dl_path = sys.argv[3] | 222 | new_dl_path = sys.argv[2] | 
| 221 | else: | 223 | else: | 
| 222 | new_prefix = sys.argv[2].encode() | 224 | new_prefix = sys.argv[1].encode() | 
| 223 | new_dl_path = sys.argv[3].encode() | 225 | new_dl_path = sys.argv[2].encode() | 
| 224 | |||
| 225 | executables_list = sys.argv[4:] | ||
| 226 | 226 | ||
| 227 | old_prefix_ne = b(sys.argv[1]) | 227 | executables_list = sys.argv[3:] | 
| 228 | old_prefix = re.compile(re.escape(old_prefix_ne)); | ||
| 229 | 228 | ||
| 230 | for e in executables_list: | 229 | for e in executables_list: | 
| 231 | perms = os.stat(e)[stat.ST_MODE] | 230 | perms = os.stat(e)[stat.ST_MODE] | 
