Update 'almalinux/gitutils/blob_upload.py'
This commit is contained in:
parent
804cca076e
commit
843e9670e0
@ -38,6 +38,8 @@ def init_arg_parser() -> argparse.ArgumentParser:
|
|||||||
'sources.almalinux.org')
|
'sources.almalinux.org')
|
||||||
arg_parser.add_argument('-o', '--output-metadata', metavar='OUTPUT_FILE',
|
arg_parser.add_argument('-o', '--output-metadata', metavar='OUTPUT_FILE',
|
||||||
help='output metadata file path')
|
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',
|
arg_parser.add_argument('-p', '--private', action='store_true',
|
||||||
help='set uploaded file mode to private. All '
|
help='set uploaded file mode to private. All '
|
||||||
'uploaded files are public by default')
|
'uploaded files are public by default')
|
||||||
@ -131,7 +133,7 @@ def main():
|
|||||||
iterator = get_file_iterator(args.file, args.input_metadata)
|
iterator = get_file_iterator(args.file, args.input_metadata)
|
||||||
out_fd = None
|
out_fd = None
|
||||||
if args.output_metadata:
|
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:
|
try:
|
||||||
for rel_path, checksum, checksum_type in iterator:
|
for rel_path, checksum, checksum_type in iterator:
|
||||||
file_path = normalize_path(rel_path)
|
file_path = normalize_path(rel_path)
|
||||||
|
Loading…
Reference in New Issue
Block a user