mirror of
https://github.com/libretro/scummvm.git
synced 2025-01-09 11:20:56 +00:00
SYMBIAN: Fix exception in thread function for piper.py and build_apps.py
Allow build older version with current symbian_builder module in case regression. Set verbose option in installer builder instead error-checking. Fix ugly 'crcrlf' line endings.
This commit is contained in:
parent
d48a14fd08
commit
f992ae017b
@ -26,6 +26,10 @@ import multiprocessing as mp
|
|||||||
|
|
||||||
from common_names import *
|
from common_names import *
|
||||||
|
|
||||||
|
#workaround for "threading bug in strptime"
|
||||||
|
#see - https://stackoverflow.com/questions/32245560/module-object-has-no-attribute-strptime-with-several-threads-python/46401422
|
||||||
|
import _strptime
|
||||||
|
|
||||||
prj_template = "PRJ_MMPFILES\n%s"
|
prj_template = "PRJ_MMPFILES\n%s"
|
||||||
prj_path = "paralell_build"
|
prj_path = "paralell_build"
|
||||||
|
|
||||||
@ -44,7 +48,7 @@ def thread_func(q, plats):
|
|||||||
pass
|
pass
|
||||||
else:
|
else:
|
||||||
raise
|
raise
|
||||||
|
|
||||||
fname = os.path.join(plats, fileName)
|
fname = os.path.join(plats, fileName)
|
||||||
fname = os.path.join("..", fname)
|
fname = os.path.join("..", fname)
|
||||||
fname = os.path.join("..", fname)
|
fname = os.path.join("..", fname)
|
||||||
@ -52,7 +56,7 @@ def thread_func(q, plats):
|
|||||||
tmp = os.path.join(pth, "bld.inf")
|
tmp = os.path.join(pth, "bld.inf")
|
||||||
SafeWriteFile(tmp, prj_template %fname)
|
SafeWriteFile(tmp, prj_template %fname)
|
||||||
|
|
||||||
|
|
||||||
#Needed because datetime.now() returns the same time for every call
|
#Needed because datetime.now() returns the same time for every call
|
||||||
start = time.strftime("%H:%M:%S")
|
start = time.strftime("%H:%M:%S")
|
||||||
|
|
||||||
@ -60,12 +64,19 @@ def thread_func(q, plats):
|
|||||||
out, err = cmd.communicate()
|
out, err = cmd.communicate()
|
||||||
cmd1 = subprocess.Popen('abld build gcce urel', stdout=subprocess.PIPE, stderr=subprocess.PIPE, cwd=pth, shell=True)
|
cmd1 = subprocess.Popen('abld build gcce urel', stdout=subprocess.PIPE, stderr=subprocess.PIPE, cwd=pth, shell=True)
|
||||||
out1, err1 = cmd1.communicate()
|
out1, err1 = cmd1.communicate()
|
||||||
|
|
||||||
|
end = time.strftime("%H:%M:%S" )
|
||||||
|
start_dt = datetime.strptime(start, '%H:%M:%S')
|
||||||
|
end_dt = datetime.strptime(end, '%H:%M:%S')
|
||||||
|
diff = (end_dt - start_dt)
|
||||||
|
|
||||||
out = out + out1
|
out = out + out1
|
||||||
err = err + err1
|
err = err + err1
|
||||||
# I hope it correctly stores logs in parallel tasks
|
# I hope it correctly stores logs in parallel tasks
|
||||||
# after cmd.communicate() we have ugly 'crcrlf' line endings
|
# after cmd.communicate() we have ugly 'crcrlf' line endings
|
||||||
SafeWriteFile(build_log, out.replace(u"\r", u""), 'a')
|
AppendToFile(build_log, out.replace(u"\r", u""))
|
||||||
SafeWriteFile(build_err, err.replace(u"\r", u""), 'a')
|
AppendToFile(build_err, err.replace(u"\r", u""))
|
||||||
|
AppendToFile(build_time, "Engine %s build time: %s.\n" %(fileName, str(diff)) )
|
||||||
|
|
||||||
def build_apps(plats):
|
def build_apps(plats):
|
||||||
q = Queue.Queue()
|
q = Queue.Queue()
|
||||||
|
@ -27,11 +27,11 @@ from common_names import *
|
|||||||
|
|
||||||
def makesis(pkg, path):
|
def makesis(pkg, path):
|
||||||
print "pkg: %s" %pkg
|
print "pkg: %s" %pkg
|
||||||
t = "makesis -c %s" %pkg
|
cmd = subprocess.Popen("makesis -v %s" %pkg, stdout=subprocess.PIPE, stderr=subprocess.PIPE, cwd=path, shell=True)
|
||||||
cmd = subprocess.Popen(t, stdout=subprocess.PIPE, stderr=subprocess.PIPE, cwd=path, shell=True)
|
|
||||||
out, err = cmd.communicate()
|
out, err = cmd.communicate()
|
||||||
SafeWriteFile(build_log, out)
|
#After cmd.communicate() we have ugly 'crcrlf' line endings
|
||||||
SafeWriteFile(build_err, err)
|
AppendToFile(build_log, out.replace(u"\r", u""))
|
||||||
|
AppendToFile(build_err, err.replace(u"\r", u""))
|
||||||
|
|
||||||
def create_installers(path):
|
def create_installers(path):
|
||||||
t = os.listdir(path)
|
t = os.listdir(path)
|
||||||
|
@ -65,8 +65,11 @@ def checkMacro(macro, active_conf = active_config):
|
|||||||
|
|
||||||
def processModule_mk(folder, mmp_file, active_conf = active_config):
|
def processModule_mk(folder, mmp_file, active_conf = active_config):
|
||||||
pth = os.path.join('..\..\..', folder)
|
pth = os.path.join('..\..\..', folder)
|
||||||
with open(os.path.join(pth, "module.mk")) as ff:
|
try:
|
||||||
f = ff.readlines()
|
with open(os.path.join(pth, "module.mk")) as ff:
|
||||||
|
f = ff.readlines()
|
||||||
|
except IOError: #folder added in newer version
|
||||||
|
return
|
||||||
pth = os.path.join('..\..\..\..', folder)
|
pth = os.path.join('..\..\..\..', folder)
|
||||||
SafeWriteFile(mmp_file, "\nSOURCEPATH %s\n" %pth, 'a')
|
SafeWriteFile(mmp_file, "\nSOURCEPATH %s\n" %pth, 'a')
|
||||||
|
|
||||||
|
@ -26,6 +26,10 @@ import multiprocessing as mp
|
|||||||
|
|
||||||
from common_names import *
|
from common_names import *
|
||||||
|
|
||||||
|
#workaround for "threading bug in strptime"
|
||||||
|
#see - https://stackoverflow.com/questions/32245560/module-object-has-no-attribute-strptime-with-several-threads-python/46401422
|
||||||
|
import _strptime
|
||||||
|
|
||||||
prj_template = "PRJ_MMPFILES\n%s"
|
prj_template = "PRJ_MMPFILES\n%s"
|
||||||
prj_path = "paralell_build"
|
prj_path = "paralell_build"
|
||||||
|
|
||||||
|
@ -148,7 +148,6 @@ def SaveDependency(build, pkg):
|
|||||||
sis_major_version, sis_minor_version, sis_build_number, dep_name))
|
sis_major_version, sis_minor_version, sis_build_number, dep_name))
|
||||||
|
|
||||||
def ResolvePackName(ordinal, target, build):
|
def ResolvePackName(ordinal, target, build):
|
||||||
print int(ordinal) + 1
|
|
||||||
tmp = package_name %(str(ordinal +1) + " " + target)
|
tmp = package_name %(str(ordinal +1) + " " + target)
|
||||||
if build == 'full':
|
if build == 'full':
|
||||||
tmp += " test"
|
tmp += " test"
|
||||||
@ -158,15 +157,15 @@ def CreateLastPkg(install_uid, build, path, ordinal, target):
|
|||||||
pkg = path %(ordinal +1)
|
pkg = path %(ordinal +1)
|
||||||
pkg_cmdline = path %( str(ordinal +1) + "_cmdline")
|
pkg_cmdline = path %( str(ordinal +1) + "_cmdline")
|
||||||
pack_name = ResolvePackName(ordinal, target, build)
|
pack_name = ResolvePackName(ordinal, target, build)
|
||||||
|
|
||||||
SafeWriteFile(pkg, pkg_template %(pack_name, install_uid, sis_major_version, sis_minor_version, sis_build_number) )
|
SafeWriteFile(pkg, pkg_template %(pack_name, install_uid, sis_major_version, sis_minor_version, sis_build_number) )
|
||||||
SafeWriteFile(pkg_cmdline, pkg_template %(pack_name, install_uid, sis_major_version, sis_minor_version, sis_build_number) )
|
SafeWriteFile(pkg_cmdline, pkg_template %(pack_name, install_uid, sis_major_version, sis_minor_version, sis_build_number) )
|
||||||
SaveDependency(build, pkg)
|
SaveDependency(build, pkg)
|
||||||
SaveDependency(build, pkg_cmdline)
|
SaveDependency(build, pkg_cmdline)
|
||||||
|
|
||||||
AppendToFile(pkg, pkg_licenses_show)
|
AppendToFile(pkg, pkg_licenses_show)
|
||||||
AppendToFile(pkg_cmdline, pkg_licenses_show)
|
AppendToFile(pkg_cmdline, pkg_licenses_show)
|
||||||
|
|
||||||
SaveInstallData(pkg, build, ordinal*2 + 1, toResolve = False)
|
SaveInstallData(pkg, build, ordinal*2 + 1, toResolve = False)
|
||||||
SaveInstallData(pkg_cmdline, build, ordinal*2 + 1)
|
SaveInstallData(pkg_cmdline, build, ordinal*2 + 1)
|
||||||
|
|
||||||
@ -174,12 +173,12 @@ def CreatePkg(install_uid, build, path, ordinal, target):
|
|||||||
pkg = path %(ordinal +1)
|
pkg = path %(ordinal +1)
|
||||||
pkg_cmdline = path %( str(ordinal +1) + "_cmdline")
|
pkg_cmdline = path %( str(ordinal +1) + "_cmdline")
|
||||||
pack_name = ResolvePackName(ordinal, target, build)
|
pack_name = ResolvePackName(ordinal, target, build)
|
||||||
|
|
||||||
SafeWriteFile(pkg, pkg_template %(pack_name, install_uid, sis_major_version, sis_minor_version, sis_build_number) )
|
SafeWriteFile(pkg, pkg_template %(pack_name, install_uid, sis_major_version, sis_minor_version, sis_build_number) )
|
||||||
SafeWriteFile(pkg_cmdline, pkg_template %(pack_name, install_uid, sis_major_version, sis_minor_version, sis_build_number) )
|
SafeWriteFile(pkg_cmdline, pkg_template %(pack_name, install_uid, sis_major_version, sis_minor_version, sis_build_number) )
|
||||||
SaveDependency(build, pkg)
|
SaveDependency(build, pkg)
|
||||||
SaveDependency(build, pkg_cmdline)
|
SaveDependency(build, pkg_cmdline)
|
||||||
|
|
||||||
AppendToFile(pkg, pkg_licenses_show)
|
AppendToFile(pkg, pkg_licenses_show)
|
||||||
AppendToFile(pkg_cmdline, pkg_licenses_show)
|
AppendToFile(pkg_cmdline, pkg_licenses_show)
|
||||||
|
|
||||||
@ -191,20 +190,20 @@ def CreatePkg(install_uid, build, path, ordinal, target):
|
|||||||
def CreateFirstPkg(install_uid, build, path, target):
|
def CreateFirstPkg(install_uid, build, path, target):
|
||||||
ext = 1
|
ext = 1
|
||||||
cmd = str(ext) + "_cmdline"
|
cmd = str(ext) + "_cmdline"
|
||||||
|
|
||||||
pkg = path %ext
|
pkg = path %ext
|
||||||
pkg_cmdline = path %cmd
|
pkg_cmdline = path %cmd
|
||||||
pack_name = ResolvePackName(0, target, build)
|
pack_name = ResolvePackName(0, target, build)
|
||||||
|
|
||||||
SafeWriteFile(pkg, pkg_template %(pack_name, install_uid, sis_major_version, sis_minor_version, sis_build_number) )
|
SafeWriteFile(pkg, pkg_template %(pack_name, install_uid, sis_major_version, sis_minor_version, sis_build_number) )
|
||||||
SafeWriteFile(pkg_cmdline, pkg_template %(pack_name, install_uid, sis_major_version, sis_minor_version, sis_build_number) )
|
SafeWriteFile(pkg_cmdline, pkg_template %(pack_name, install_uid, sis_major_version, sis_minor_version, sis_build_number) )
|
||||||
|
|
||||||
AppendToFile(pkg, pkg_licenses_install)
|
AppendToFile(pkg, pkg_licenses_install)
|
||||||
AppendToFile(pkg_cmdline, pkg_licenses_install)
|
AppendToFile(pkg_cmdline, pkg_licenses_install)
|
||||||
if build == 'release':
|
if build == 'release':
|
||||||
AppendToFile(pkg, mif_install)
|
AppendToFile(pkg, mif_install)
|
||||||
AppendToFile(pkg_cmdline, ResolveEpocRoot(mif_install))
|
AppendToFile(pkg_cmdline, ResolveEpocRoot(mif_install))
|
||||||
|
|
||||||
SaveInstallData(pkg, build, 1, toResolve = False)
|
SaveInstallData(pkg, build, 1, toResolve = False)
|
||||||
SaveInstallData(pkg_cmdline, build, 1)
|
SaveInstallData(pkg_cmdline, build, 1)
|
||||||
SaveInstallData(pkg, build, 2, toResolve = False)
|
SaveInstallData(pkg, build, 2, toResolve = False)
|
||||||
|
Loading…
Reference in New Issue
Block a user