diff --git a/almalinux/gitutils/blob_upload.py b/almalinux/gitutils/blob_upload.py index d7b7f88..31fb3c3 100644 --- a/almalinux/gitutils/blob_upload.py +++ b/almalinux/gitutils/blob_upload.py @@ -149,13 +149,17 @@ def main(): ) out_fd = None if args.append_metadata: - file_mdoe = 'a' + file_mode = 'a' else: - file_mdoe = 'w' + file_mode = 'w' if args.output_metadata: - out_fd = open(args.output_metadata, file_mdoe) + out_fd = open(args.output_metadata, file_mode) try: for rel_path, checksum, checksum_type in iterator: + if args.sha512: + line_to_write = f'SHA512 ({rel_path}) = {checksum}\n' + else: + line_to_write = f'{checksum} {rel_path}\n' file_path = normalize_path(rel_path) if not args.file: real_checksum = get_file_checksum(file_path, checksum_type) @@ -172,7 +176,7 @@ def main(): else: logging.info(f'{rel_path} is already uploaded: {file_url}') if out_fd: - out_fd.write(f'{checksum} {rel_path}\n') + out_fd.write(line_to_write) finally: if out_fd: out_fd.close() diff --git a/setup.py b/setup.py index ff258ad..bf8d18a 100644 --- a/setup.py +++ b/setup.py @@ -5,7 +5,7 @@ with open("README.md", "r", encoding="utf-8") as fd: setup( name="almalinux-git-utils", - version="0.0.2", + version="0.0.3", author="Eugene Zamriy", author_email="ezamriy@almalinux.org", description="Utilities for working with the AlmaLinux OS Git server",