Update 'almalinux/gitutils/blob_upload.py'

This commit is contained in:
Stepan Oksanichenko 2023-05-11 12:34:05 +00:00
parent 804cca076e
commit 843e9670e0

View File

@ -38,6 +38,8 @@ def init_arg_parser() -> argparse.ArgumentParser:
'sources.almalinux.org')
arg_parser.add_argument('-o', '--output-metadata', metavar='OUTPUT_FILE',
help='output metadata file path')
arg_parser.add_argument('-a', '--append-metadata', action='store_true',
help='Append to an output metadata')
arg_parser.add_argument('-p', '--private', action='store_true',
help='set uploaded file mode to private. All '
'uploaded files are public by default')
@ -131,7 +133,7 @@ def main():
iterator = get_file_iterator(args.file, args.input_metadata)
out_fd = None
if args.output_metadata:
out_fd = open(args.output_metadata, 'w')
out_fd = open(args.output_metadata, 'w+' if args.append_metadata else 'w')
try:
for rel_path, checksum, checksum_type in iterator:
file_path = normalize_path(rel_path)