Merge pull request #292 from kiwix/deps_archive_xz

[TRAVIS] Use xz compression to create the deps archives.
This commit is contained in:
Matthieu Gautier 2019-02-07 11:30:27 +01:00 committed by GitHub
commit a3d7d9950c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 10 additions and 11 deletions

View File

@ -183,7 +183,7 @@ def make_archive(project, platform):
def make_deps_archive(target, full=False):
archive_name = "deps_{}_{}_{}.tar.gz".format(
archive_name = "deps_{}_{}_{}.tar.xz".format(
TRAVIS_OS_NAME, PLATFORM, target)
print_message("Create archive {}.", archive_name)
files_to_archive = [BASE_DIR/'INSTALL']
@ -218,15 +218,14 @@ def make_deps_archive(target, full=False):
base_deps_versions['pugixml'])]
files_to_archive += HOME.glob('BUILD_*/pugixml-{}'.format(
base_deps_versions['pugixml']))
files_to_archive += HOME.glob('**/TOOLCHAINS')
toolchains_subdirs = HOME.glob('**/TOOLCHAINS/*/*')
for subdir in toolchains_subdirs:
if not subdir.match('tools'):
files_to_archive.append(subdir)
counter = 50
with tarfile.open(str(relative_path/archive_name), 'w:gz') as tar:
with tarfile.open(str(relative_path/archive_name), 'w:xz') as tar:
for name in set(files_to_archive):
counter -= 1
if not counter:
print('.', end='', flush=True)
counter = 50
tar.add(str(name), arcname=str(name.relative_to(relative_path)))
return relative_path/archive_name
@ -261,13 +260,13 @@ def download_base_archive(base_name):
batch = resource.read(batch_size)
if not batch:
break
print(".", end="")
print(".", end="", flush=True)
file.write(batch)
return file_path
if PLATFORM != 'flatpak':
# The first thing we need to do is to (potentially) download already compiled base dependencies.
base_dep_archive_name = "base_deps_{os}_{platform}_{version}.tar.gz".format(
base_dep_archive_name = "base_deps_{os}_{platform}_{version}.tar.xz".format(
os=TRAVIS_OS_NAME,
platform=PLATFORM,
version=base_deps_meta_version)
@ -281,7 +280,7 @@ if PLATFORM != 'flatpak':
print_message("Cannot get archive. Build dependencies")
if PLATFORM == 'android':
for arch in ('arm', 'arm64', 'x86', 'x86_64'):
archive_name = "base_deps_{os}_android_{arch}_{version}.tar.gz".format(
archive_name = "base_deps_{os}_android_{arch}_{version}.tar.xz".format(
os=TRAVIS_OS_NAME,
arch=arch,
version=base_deps_meta_version)