diff options
author | Eelco Dolstra <eelco.dolstra@logicblox.com> | 2015-12-15 10:10:59 +0000 |
---|---|---|
committer | Eelco Dolstra <eelco.dolstra@logicblox.com> | 2015-12-15 10:11:55 +0000 |
commit | 903803a1f379951c68224f847ccdf717fcf2d36c (patch) | |
tree | 6aa2d1bbf3fb77904141d2f227e13f64336b0782 /maintainers | |
parent | 46905425cfcfd29da9f5bf17ae5917d3cf83f0d6 (diff) |
Allow uploading multiple files
Diffstat (limited to 'maintainers')
-rwxr-xr-x | maintainers/scripts/copy-tarballs.pl | 23 |
1 files changed, 16 insertions, 7 deletions
diff --git a/maintainers/scripts/copy-tarballs.pl b/maintainers/scripts/copy-tarballs.pl index 6be1300e5130a..ad626e4bd8d63 100755 --- a/maintainers/scripts/copy-tarballs.pl +++ b/maintainers/scripts/copy-tarballs.pl @@ -69,15 +69,24 @@ sub uploadFile { redirect "sha512/$sha512_32", $mainKey; } -my $op = $ARGV[0] // ""; +my $op = shift @ARGV; if ($op eq "--file") { - my $fn = $ARGV[1] // die "$0: --file requires a file name\n"; - if (alreadyMirrored("sha512", hashFile("sha512", 0, $fn))) { - print STDERR "$fn is already mirrored\n"; - } else { - uploadFile($fn, basename $fn); + my $res = 0; + foreach my $fn (@ARGV) { + eval { + if (alreadyMirrored("sha512", hashFile("sha512", 0, $fn))) { + print STDERR "$fn is already mirrored\n"; + } else { + uploadFile($fn, basename $fn); + } + }; + if ($@) { + warn "$@\n"; + $res = 1; + } } + exit $res; } elsif ($op eq "--expr") { @@ -138,5 +147,5 @@ elsif ($op eq "--expr") { } else { - die "Syntax: $0 --file FILENAME | --expr EXPR\n"; + die "Syntax: $0 --file FILENAMES... | --expr EXPR\n"; } |