mirror of https://github.com/tp4a/teleport
修复一个愚蠢的错误:编译时会删除/目录!!!
parent
f56277fc30
commit
b5c86b94fa
|
@ -7,7 +7,6 @@ from core.env import env
|
||||||
|
|
||||||
ctx = BuildContext()
|
ctx = BuildContext()
|
||||||
with_rdp = os.path.exists(os.path.join(env.root_path, 'server', 'tp_core', 'protocol', 'rdp'))
|
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:
|
class BuilderBase:
|
||||||
|
@ -70,9 +69,9 @@ class BuilderLinux(BuilderBase):
|
||||||
|
|
||||||
out_path = os.path.join(env.root_path, 'out', 'server', ctx.bits_path, 'bin')
|
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 = [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:
|
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'))
|
# out_files.extend(os.path.join(out_path, 'libtptelnet.so'))
|
||||||
|
|
||||||
for f in out_files:
|
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_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 = [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:
|
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'))
|
# out_files.extend(os.path.join(out_path, 'libtptelnet.so'))
|
||||||
|
|
||||||
for f in out_files:
|
for f in out_files:
|
||||||
|
@ -155,15 +154,6 @@ def main():
|
||||||
if 'server' in argv:
|
if 'server' in argv:
|
||||||
builder.build_server()
|
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__':
|
if __name__ == '__main__':
|
||||||
try:
|
try:
|
||||||
|
|
|
@ -9,6 +9,7 @@ import time
|
||||||
import platform
|
import platform
|
||||||
|
|
||||||
from . import colorconsole as cc
|
from . import colorconsole as cc
|
||||||
|
from . import utils
|
||||||
|
|
||||||
rm_file_every_level = ['.pyc', '.pyo']
|
rm_file_every_level = ['.pyc', '.pyo']
|
||||||
|
|
||||||
|
@ -47,7 +48,8 @@ def remove_cache(path):
|
||||||
for d in dir_list:
|
for d in dir_list:
|
||||||
d = d.lower()
|
d = d.lower()
|
||||||
if d == '__pycache__':
|
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
|
continue
|
||||||
remove_cache(os.path.join(parent, d))
|
remove_cache(os.path.join(parent, d))
|
||||||
|
|
||||||
|
|
|
@ -107,7 +107,7 @@ def extension_suffixes():
|
||||||
|
|
||||||
|
|
||||||
def remove(*args):
|
def remove(*args):
|
||||||
path = os.path.join(*args)
|
path = os.path.abspath(os.path.join(*args))
|
||||||
|
|
||||||
cc.v('remove [%s] ...' % path, end='')
|
cc.v('remove [%s] ...' % path, end='')
|
||||||
if not os.path.exists(path):
|
if not os.path.exists(path):
|
||||||
|
@ -118,6 +118,8 @@ def remove(*args):
|
||||||
cc.v('.', end='')
|
cc.v('.', end='')
|
||||||
try:
|
try:
|
||||||
if os.path.isdir(path):
|
if os.path.isdir(path):
|
||||||
|
if path == '/':
|
||||||
|
raise RuntimeError('### What are you doing?!! ###')
|
||||||
shutil.rmtree(path, ignore_errors=True)
|
shutil.rmtree(path, ignore_errors=True)
|
||||||
time.sleep(0.5)
|
time.sleep(0.5)
|
||||||
else:
|
else:
|
||||||
|
|
Loading…
Reference in New Issue