summaryrefslogtreecommitdiff
path: root/src/hydrilla/builder/build.py
diff options
context:
space:
mode:
authorWojtek Kosior <koszko@koszko.org>2022-02-09 15:30:26 +0100
committerWojtek Kosior <koszko@koszko.org>2022-02-09 15:30:26 +0100
commitfd38a0e1dd3dbe0de365e938ac3dca3bee4320dd (patch)
tree18caacf2b9f331c0b986d34e0c12641027342876 /src/hydrilla/builder/build.py
parent456ad6c0760329943f4f8e2b2b7dc0e260cba128 (diff)
downloadhydrilla-builder-fd38a0e1dd3dbe0de365e938ac3dca3bee4320dd.tar.gz
hydrilla-builder-fd38a0e1dd3dbe0de365e938ac3dca3bee4320dd.zip
change file path format
From now on we'll be using format 'file/sha256/<hash>' instead of 'file/sha256-<hash>'.
Diffstat (limited to 'src/hydrilla/builder/build.py')
-rw-r--r--src/hydrilla/builder/build.py7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/hydrilla/builder/build.py b/src/hydrilla/builder/build.py
index 3503f7a..0044614 100644
--- a/src/hydrilla/builder/build.py
+++ b/src/hydrilla/builder/build.py
@@ -339,14 +339,13 @@ class Build:
def write_package_files(self, dstpath: Path):
"""Write package files under 'dstpath' for distribution."""
- file_dir_path = (dstpath / 'file').resolve()
+ file_dir_path = (dstpath / 'file' / 'sha256').resolve()
file_dir_path.mkdir(parents=True, exist_ok=True)
for file_ref in self.files_by_path.values():
if file_ref.include_in_distribution:
- file_name = f'sha256-{file_ref.contents_hash}'
- with open(file_dir_path / file_name, 'wb') as output:
- output.write(file_ref.contents)
+ file_path = file_dir_path / file_ref.contents_hash
+ file_path.write_bytes(file_ref.contents)
source_dir_path = (dstpath / 'source').resolve()
source_dir_path.mkdir(parents=True, exist_ok=True)