From b6d31c37f4aaa4d4725d0f04e0d68f31f4f37c23 Mon Sep 17 00:00:00 2001 From: akwizgran <michael@briarproject.org> Date: Mon, 21 Nov 2022 16:22:57 +0000 Subject: [PATCH] Use relative paths in zip files. --- build-binary.py | 4 +--- utils.py | 6 +++--- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/build-binary.py b/build-binary.py index 440d8f2..2cb187a 100755 --- a/build-binary.py +++ b/build-binary.py @@ -215,10 +215,8 @@ def create_sources_jar(tool, versions, platform): for file in glob(os.path.join(repo_dir, '*')): reset_time(file, versions) jar_files.append(os.path.relpath(file, repo_dir)) - jar_file = get_sources_file_name(tool, versions, platform) - jar_path = os.path.abspath(jar_file) + jar_path = get_sources_file_name(tool, versions, platform) check_call(['jar', 'cf', jar_path] + jar_files, cwd=repo_dir) - return jar_file def create_pom_file(tool, versions, platform): diff --git a/utils.py b/utils.py index 9d9860e..68abaad 100644 --- a/utils.py +++ b/utils.py @@ -67,9 +67,9 @@ def zip_files(files, zip_name, versions): reset_time(file_name, versions) # use deterministic permissions to prevent differences in zip files os.chmod(file_name, 0o755) - sha256hash = get_sha256(file_name) - print("Hash before zipping %s: %s" % (file_name, sha256hash)) - ex(['zip', '-D', '-X', zip_name] + files) + (zip_dir, zip_name) = os.path.split(zip_name) + files = list(map(lambda f : os.path.relpath(f, zip_dir), files)) + ex(['zip', '-D', '-X', zip_name] + files, cwd=zip_dir) def get_version_number(versions): -- GitLab