- 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
|
||||
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()
|
||||
|
Loading…
Reference in New Issue
Block a user