diff options
author | Eelco Dolstra <eelco.dolstra@logicblox.com> | 2015-12-16 14:28:22 +0100 |
---|---|---|
committer | Eelco Dolstra <eelco.dolstra@logicblox.com> | 2015-12-16 15:39:08 +0100 |
commit | 5eb2804cdbc5d288bebc534066577e7e1bff2409 (patch) | |
tree | bc42f4818163f5ad01bae47296b4e0686d2f33b6 /maintainers | |
parent | d5371eb0295229a5949b795e7df59ebd2e16c67e (diff) |
copy-tarballs.pl: Create redirects before uploading file
This makes the script more robust to interruption.
Diffstat (limited to 'maintainers')
-rwxr-xr-x | maintainers/scripts/copy-tarballs.pl | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/maintainers/scripts/copy-tarballs.pl b/maintainers/scripts/copy-tarballs.pl index 0098061d0f867..b1233827ad885 100755 --- a/maintainers/scripts/copy-tarballs.pl +++ b/maintainers/scripts/copy-tarballs.pl @@ -63,12 +63,6 @@ sub uploadFile { my $mainKey = "sha512/$sha512_16"; - # Upload the file as sha512/<hash-in-base-16>. - print STDERR "uploading $fn to $mainKey...\n"; - $bucket->add_key_filename($mainKey, $fn, { 'x-amz-meta-original-name' => $name }) - or die "failed to upload $fn to $mainKey\n"; - $cache{$mainKey} = 1; - # Create redirects from the other hash types. sub redirect { my ($name, $dest) = @_; @@ -82,6 +76,12 @@ sub uploadFile { redirect "sha256/$sha256_32", $mainKey; redirect "sha256/$sha256_16", $mainKey; redirect "sha512/$sha512_32", $mainKey; + + # Upload the file as sha512/<hash-in-base-16>. + print STDERR "uploading $fn to $mainKey...\n"; + $bucket->add_key_filename($mainKey, $fn, { 'x-amz-meta-original-name' => $name }) + or die "failed to upload $fn to $mainKey\n"; + $cache{$mainKey} = 1; } my $op = shift @ARGV; |