summaryrefslogtreecommitdiff
path: root/utils/common/deploy.py
diff options
context:
space:
mode:
Diffstat (limited to 'utils/common/deploy.py')
-rwxr-xr-xutils/common/deploy.py34
1 files changed, 17 insertions, 17 deletions
diff --git a/utils/common/deploy.py b/utils/common/deploy.py
index e0bb7029b8..1dbeb494dd 100755
--- a/utils/common/deploy.py
+++ b/utils/common/deploy.py
@@ -162,7 +162,7 @@ def findqt(cross=""):
162 if not result == "": 162 if not result == "":
163 return result 163 return result
164 except: 164 except:
165 print(sys.exc_value) 165 print(sys.exc_info()[1])
166 166
167 return "" 167 return ""
168 168
@@ -180,11 +180,11 @@ def checkqt(qmakebin):
180 cmdout = output.communicate() 180 cmdout = output.communicate()
181 # don't check the qmake return code here, Qt3 doesn't return 0 on -version. 181 # don't check the qmake return code here, Qt3 doesn't return 0 on -version.
182 for ou in cmdout: 182 for ou in cmdout:
183 r = re.compile("Qt[^0-9]+([0-9\.]+[a-z]*)") 183 r = re.compile(b'Qt[^0-9]+([0-9\.]+[a-z]*)')
184 m = re.search(r, ou) 184 m = re.search(r, ou)
185 if not m == None: 185 if m is not None:
186 print("Qt found: %s" % m.group(1)) 186 print("Qt found: %s" % m.group(1).decode())
187 s = re.compile("[45]\..*") 187 s = re.compile(b'[45]\..*')
188 n = re.search(s, m.group(1)) 188 n = re.search(s, m.group(1))
189 if n is not None: 189 if n is not None:
190 result = qmakebin 190 result = qmakebin
@@ -302,7 +302,7 @@ def nsisfileinject(nsis, outscript, filelist):
302 output.write(line) 302 output.write(line)
303 # inject files after the progexe binary. 303 # inject files after the progexe binary.
304 # Match the basename only to avoid path mismatches. 304 # Match the basename only to avoid path mismatches.
305 if re.match(r'^\s*File\s*.*' + os.path.basename(progexe["win32"]), \ 305 if re.match(r'^\s*File\s*.*' + os.path.basename(progexe["win32"]),
306 line, re.IGNORECASE): 306 line, re.IGNORECASE):
307 for f in filelist: 307 for f in filelist:
308 injection = " File /oname=$INSTDIR\\" + os.path.basename(f) \ 308 injection = " File /oname=$INSTDIR\\" + os.path.basename(f) \
@@ -322,7 +322,7 @@ def finddlls(program, extrapaths=[], cross=""):
322 322
323 # create list of used DLLs. Store as lower case as W32 is case-insensitive. 323 # create list of used DLLs. Store as lower case as W32 is case-insensitive.
324 dlls = [] 324 dlls = []
325 for line in cmdout[0].split('\n'): 325 for line in cmdout[0].decode().split('\n'):
326 if re.match(r'\s*DLL Name', line) != None: 326 if re.match(r'\s*DLL Name', line) != None:
327 dll = re.sub(r'^\s*DLL Name:\s+([a-zA-Z_\-0-9\.\+]+).*$', r'\1', line) 327 dll = re.sub(r'^\s*DLL Name:\s+([a-zA-Z_\-0-9\.\+]+).*$', r'\1', line)
328 dlls.append(dll.lower()) 328 dlls.append(dll.lower())
@@ -429,7 +429,7 @@ def filehashes(filename):
429 f = open(filename, 'rb') 429 f = open(filename, 'rb')
430 while True: 430 while True:
431 d = f.read(65536) 431 d = f.read(65536)
432 if d == "": 432 if d == b"":
433 break 433 break
434 m.update(d) 434 m.update(d)
435 s.update(d) 435 s.update(d)
@@ -440,12 +440,12 @@ def filestats(filename):
440 if not os.path.exists(filename): 440 if not os.path.exists(filename):
441 return 441 return
442 st = os.stat(filename) 442 st = os.stat(filename)
443 print(filename, "\n", "-" * len(filename)) 443 print("%s\n%s" % (filename, "-" * len(filename)))
444 print("Size: %i bytes" % st.st_size) 444 print("Size: %i bytes" % st.st_size)
445 h = filehashes(filename) 445 h = filehashes(filename)
446 print("md5sum: %s" % h[0]) 446 print("md5sum: %s" % h[0])
447 print("sha1sum: %s" % h[1]) 447 print("sha1sum: %s" % h[1])
448 print("-" * len(filename), "\n") 448 print("%s\n" % ("-" * len(filename)))
449 449
450 450
451def tempclean(workfolder, nopro): 451def tempclean(workfolder, nopro):
@@ -539,12 +539,12 @@ def deploy():
539 revision = gitscraper.describe_treehash(gitrepo, treehash) 539 revision = gitscraper.describe_treehash(gitrepo, treehash)
540 # try to find a version number from describe output. 540 # try to find a version number from describe output.
541 # WARNING: this is broken and just a temporary workaround! 541 # WARNING: this is broken and just a temporary workaround!
542 v = re.findall('([\d\.a-f]+)', revision) 542 v = re.findall(b'([\d\.a-f]+)', revision)
543 if v: 543 if v:
544 if v[-1].find('.') >= 0: 544 if v[-1].decode().find('.') >= 0:
545 revision = "v" + v[-1] 545 revision = "v" + v[-1].decode()
546 else: 546 else:
547 revision = v[-1] 547 revision = v[-1].decode()
548 if buildid == None: 548 if buildid == None:
549 versionextra = "" 549 versionextra = ""
550 else: 550 else:
@@ -647,7 +647,7 @@ def deploy():
647 elif platform == "darwin": 647 elif platform == "darwin":
648 archive = macdeploy(ver, sourcefolder, platform) 648 archive = macdeploy(ver, sourcefolder, platform)
649 else: 649 else:
650 if platform == "linux2": 650 if platform in ['linux', 'linux2']:
651 for p in progfiles: 651 for p in progfiles:
652 prog = sourcefolder + "/" + p 652 prog = sourcefolder + "/" + p
653 output = subprocess.Popen( 653 output = subprocess.Popen(
@@ -664,8 +664,8 @@ def deploy():
664 664
665 # display summary 665 # display summary
666 headline = "Build Summary for %s" % program 666 headline = "Build Summary for %s" % program
667 print("\n", headline, "\n", "=" * len(headline)) 667 print("\n%s\n%s" % (headline, "=" * len(headline)))
668 if not archivename == "": 668 if archivename != "":
669 filestats(archivename) 669 filestats(archivename)
670 filestats(archive) 670 filestats(archive)
671 duration = time.time() - startup 671 duration = time.time() - startup