- Write in a new format if you use SHA512 checksum
- A version is bumbed
This commit is contained in:
parent
c078cfb0a3
commit
1e8aafba61
@ -149,13 +149,17 @@ def main():
|
|||||||
)
|
)
|
||||||
out_fd = None
|
out_fd = None
|
||||||
if args.append_metadata:
|
if args.append_metadata:
|
||||||
file_mdoe = 'a'
|
file_mode = 'a'
|
||||||
else:
|
else:
|
||||||
file_mdoe = 'w'
|
file_mode = 'w'
|
||||||
if args.output_metadata:
|
if args.output_metadata:
|
||||||
out_fd = open(args.output_metadata, file_mdoe)
|
out_fd = open(args.output_metadata, file_mode)
|
||||||
try:
|
try:
|
||||||
for rel_path, checksum, checksum_type in iterator:
|
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)
|
file_path = normalize_path(rel_path)
|
||||||
if not args.file:
|
if not args.file:
|
||||||
real_checksum = get_file_checksum(file_path, checksum_type)
|
real_checksum = get_file_checksum(file_path, checksum_type)
|
||||||
@ -172,7 +176,7 @@ def main():
|
|||||||
else:
|
else:
|
||||||
logging.info(f'{rel_path} is already uploaded: {file_url}')
|
logging.info(f'{rel_path} is already uploaded: {file_url}')
|
||||||
if out_fd:
|
if out_fd:
|
||||||
out_fd.write(f'{checksum} {rel_path}\n')
|
out_fd.write(line_to_write)
|
||||||
finally:
|
finally:
|
||||||
if out_fd:
|
if out_fd:
|
||||||
out_fd.close()
|
out_fd.close()
|
||||||
|
2
setup.py
2
setup.py
@ -5,7 +5,7 @@ with open("README.md", "r", encoding="utf-8") as fd:
|
|||||||
|
|
||||||
setup(
|
setup(
|
||||||
name="almalinux-git-utils",
|
name="almalinux-git-utils",
|
||||||
version="0.0.2",
|
version="0.0.3",
|
||||||
author="Eugene Zamriy",
|
author="Eugene Zamriy",
|
||||||
author_email="ezamriy@almalinux.org",
|
author_email="ezamriy@almalinux.org",
|
||||||
description="Utilities for working with the AlmaLinux OS Git server",
|
description="Utilities for working with the AlmaLinux OS Git server",
|
||||||
|
Loading…
Reference in New Issue
Block a user