summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xscripts/relocate_sdk.py14
1 files changed, 12 insertions, 2 deletions
diff --git a/scripts/relocate_sdk.py b/scripts/relocate_sdk.py
index b247e65ce3..637ffe9483 100755
--- a/scripts/relocate_sdk.py
+++ b/scripts/relocate_sdk.py
@@ -29,6 +29,7 @@ import sys
29import stat 29import stat
30import os 30import os
31import re 31import re
32import errno
32 33
33old_prefix = re.compile("##DEFAULT_INSTALL_DIR##") 34old_prefix = re.compile("##DEFAULT_INSTALL_DIR##")
34 35
@@ -171,7 +172,7 @@ def change_dl_sysdirs():
171 172
172# MAIN 173# MAIN
173if len(sys.argv) < 4: 174if len(sys.argv) < 4:
174 exit(1) 175 exit(-1)
175 176
176new_prefix = sys.argv[1] 177new_prefix = sys.argv[1]
177new_dl_path = sys.argv[2] 178new_dl_path = sys.argv[2]
@@ -184,7 +185,16 @@ for e in executables_list:
184 else: 185 else:
185 os.chmod(e, perms|stat.S_IRWXU) 186 os.chmod(e, perms|stat.S_IRWXU)
186 187
187 f = open(e, "r+b") 188 try:
189 f = open(e, "r+b")
190 except IOError as ioex:
191 if ioex.errno == errno.ETXTBSY:
192 print("Could not open %s. File used by another process.\nPlease "\
193 "make sure you exit all processes that might use any SDK "\
194 "binaries." % e)
195 else:
196 print("Could not open %s: %s(%d)" % (e, ioex.strerror, ioex.errno))
197 exit(-1)
188 198
189 arch = get_arch() 199 arch = get_arch()
190 if arch: 200 if arch: