diff --git a/build/.idea/build.iml b/build/.idea/build.iml index 7cfc769..8a94704 100644 --- a/build/.idea/build.iml +++ b/build/.idea/build.iml @@ -2,7 +2,7 @@ - + diff --git a/build/builder/build-external.py b/build/builder/build-external.py index 4f51b8e..29b6152 100644 --- a/build/builder/build-external.py +++ b/build/builder/build-external.py @@ -80,7 +80,7 @@ class BuilderBase: def build_sqlite(self): file_name = 'sqlite-autoconf-{}.tar.gz'.format(env.ver_sqlite) - if not utils.download_file('sqlite source tarball', 'http://sqlite.org/2016/{}'.format(file_name), PATH_DOWNLOAD, file_name): + if not utils.download_file('sqlite source tarball', 'http://sqlite.org/2017/{}'.format(file_name), PATH_DOWNLOAD, file_name): return self._build_sqlite(file_name) diff --git a/build/builder/build-pysrt.py b/build/builder/build-pysrt.py index f0d3d8d..2844b02 100644 --- a/build/builder/build-pysrt.py +++ b/build/builder/build-pysrt.py @@ -3,6 +3,8 @@ import shutil import struct +import sys + from core import colorconsole as cc from core import makepyo from core import utils @@ -95,7 +97,7 @@ class PYSBase: makepyo.make(_tmp_) cc.v('compress into python.zip...') - utils.make_zip(_tmp_, out_file) + utils.make_zip(_tmp_, out_file, from_parent=False) utils.ensure_file_exists(out_file) cc.v('remove temp folder...') diff --git a/build/builder/build-version.py b/build/builder/build-version.py index f519cf5..75e6461 100644 --- a/build/builder/build-version.py +++ b/build/builder/build-version.py @@ -120,7 +120,7 @@ class Builder: rc_file = os.path.join(env.root_path, 'client', 'tp_assist', 'tp_assist.rc') self._update_vs_rc(rc_file, self.VER_TELEPORT_ASSIST) - nsi_file = os.path.join(env.root_path, 'dist', 'windows', 'client', 'assist', 'installer.nsi') + nsi_file = os.path.join(env.root_path, 'dist', 'client', 'windows', 'assist', 'installer.nsi') self._update_nsi_rc(nsi_file, self.VER_TELEPORT_ASSIST) def make_tp_core_ver(self): diff --git a/build/builder/core/utils.py b/build/builder/core/utils.py index d16dd1a..3b942d0 100644 --- a/build/builder/core/utils.py +++ b/build/builder/core/utils.py @@ -23,8 +23,28 @@ def _check_download_file(file_name): if 'Everything is Ok' in output: return True else: - cc.w('[fixme] how to test file on Linux? ', end='') - return True + x = os.path.splitext(file_name) + # print('ext:', x) + if x[-1].lower() == '.zip': + ret, output = sys_exec('zip -T "{}"'.format(file_name), False) + # print('test .zip:', ret, output) + if ret == 0: + return True + elif x[-1].lower() == '.xz': + ret, output = sys_exec('xz -t "{}"'.format(file_name), False) + # print('test .xz:', ret, output) + if ret == 0: + return True + elif x[-1].lower() == '.gz': + ret, output = sys_exec('gzip -t "{}"'.format(file_name), False) + # print('test .gz:', ret, output) + if ret == 0: + return True + else: + cc.w('[fixme] how to test {} on Linux? '.format(x[-1]), end='') + return True + + return False def download_file(desc, url, target_path, file_name): @@ -331,20 +351,33 @@ def strip(filename): return True -def make_zip(src_path, to_file): +def make_zip(src_path, to_file, from_parent=True): cc.v('compress folder into .zip...') - if env.is_win: - src_path = os.path.abspath(src_path) - _parent = os.path.abspath(os.path.join(src_path, '..')) - _folder = src_path[len(_parent) + 1:] + src_path = os.path.abspath(src_path) + _parent = os.path.abspath(os.path.join(src_path, '..')) + _folder = src_path[len(_parent) + 1:] + + if env.is_win: old_p = os.getcwd() - os.chdir(_parent) - cmd = '""{}" a "{}" "{}""'.format(env.zip7, to_file, _folder) + if from_parent: + os.chdir(_parent) + cmd = '""{}" a "{}" "{}""'.format(env.zip7, to_file, _folder) + else: + os.chdir(src_path) + cmd = '""{}" a "{}" "*""'.format(env.zip7, to_file) os.system(cmd) os.chdir(old_p) elif env.is_linux: - pass + old_p = os.getcwd() + if from_parent: + os.chdir(_parent) + cmd = 'zip -r "{}" "{}"'.format(to_file, _folder) + else: + os.chdir(src_path) + cmd = 'zip -q -r "{}" ./*'.format(to_file) + os.system(cmd) + os.chdir(old_p) else: raise RuntimeError('not support this platform.') diff --git a/config.ini.in b/config.ini.in index 4e88900..d10b8ee 100644 --- a/config.ini.in +++ b/config.ini.in @@ -35,7 +35,7 @@ cmake = /opt/cmake/bin/cmake openssl = 1.0.2h,1000208f libuv = 1.9.1 mbedtls = 2.3.0 -sqlite = 3160200 +sqlite = 3170000 libssh = 0.7.4 jsoncpp = 0.10.6 mongoose = 6.6 diff --git a/server/.idea/server.iml b/server/.idea/server.iml index 4d21107..f08604b 100644 --- a/server/.idea/server.iml +++ b/server/.idea/server.iml @@ -1,114 +1,2 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file + \ No newline at end of file