diff --git a/build/builder/build-server.py b/build/builder/build-server.py index ff0d1eb..da7a4b2 100644 --- a/build/builder/build-server.py +++ b/build/builder/build-server.py @@ -7,7 +7,6 @@ from core.env import env ctx = BuildContext() with_rdp = os.path.exists(os.path.join(env.root_path, 'server', 'tp_core', 'protocol', 'rdp')) -with_telnet = os.path.exists(os.path.join(env.root_path, 'server', 'tp_core', 'protocol', 'telnet')) class BuilderBase: @@ -70,9 +69,9 @@ class BuilderLinux(BuilderBase): out_path = os.path.join(env.root_path, 'out', 'server', ctx.bits_path, 'bin') out_files = [os.path.join(out_path, 'tp_core'), os.path.join(out_path, 'tp_web')] - out_files.extend(os.path.join(out_path, 'libtpssh.so')) + out_files.append(os.path.join(out_path, 'libtpssh.so')) if with_rdp: - out_files.extend(os.path.join(out_path, 'libtprdp.so')) + out_files.append(os.path.join(out_path, 'libtprdp.so')) # out_files.extend(os.path.join(out_path, 'libtptelnet.so')) for f in out_files: @@ -98,9 +97,9 @@ class BuilderMacOS(BuilderBase): out_path = os.path.join(env.root_path, 'out', 'server', ctx.bits_path, 'bin') out_files = [os.path.join(out_path, 'tp_core'), os.path.join(out_path, 'tp_web')] - out_files.extend(os.path.join(out_path, 'libtpssh.so')) + out_files.append(os.path.join(out_path, 'libtpssh.so')) if with_rdp: - out_files.extend(os.path.join(out_path, 'libtprdp.so')) + out_files.append(os.path.join(out_path, 'libtprdp.so')) # out_files.extend(os.path.join(out_path, 'libtptelnet.so')) for f in out_files: @@ -155,15 +154,6 @@ def main(): if 'server' in argv: builder.build_server() - # if 'app' in argv: - # builder.build_app() - - # if 'installer' in argv: - # builder.build_installer() - - # if 'runtime' in argv: - # builder.build_runtime() - if __name__ == '__main__': try: diff --git a/build/builder/core/makepyo.py b/build/builder/core/makepyo.py index 30900ca..fffbcdf 100644 --- a/build/builder/core/makepyo.py +++ b/build/builder/core/makepyo.py @@ -9,6 +9,7 @@ import time import platform from . import colorconsole as cc +from . import utils rm_file_every_level = ['.pyc', '.pyo'] @@ -47,7 +48,8 @@ def remove_cache(path): for d in dir_list: d = d.lower() if d == '__pycache__': - shutil.rmtree(os.path.join(parent, d)) + # shutil.rmtree(os.path.join(parent, d)) + utils.remove(os.path.join(parent, d)) continue remove_cache(os.path.join(parent, d)) diff --git a/build/builder/core/utils.py b/build/builder/core/utils.py index 3131b41..5ddd8e6 100644 --- a/build/builder/core/utils.py +++ b/build/builder/core/utils.py @@ -107,7 +107,7 @@ def extension_suffixes(): def remove(*args): - path = os.path.join(*args) + path = os.path.abspath(os.path.join(*args)) cc.v('remove [%s] ...' % path, end='') if not os.path.exists(path): @@ -118,6 +118,8 @@ def remove(*args): cc.v('.', end='') try: if os.path.isdir(path): + if path == '/': + raise RuntimeError('### What are you doing?!! ###') shutil.rmtree(path, ignore_errors=True) time.sleep(0.5) else: