summary refs log tree commit diff
path: root/maintainers
diff options
context:
space:
mode:
authorEelco Dolstra <eelco.dolstra@logicblox.com>2015-12-16 14:28:22 +0100
committerEelco Dolstra <eelco.dolstra@logicblox.com>2015-12-16 15:39:08 +0100
commit5eb2804cdbc5d288bebc534066577e7e1bff2409 (patch)
treebc42f4818163f5ad01bae47296b4e0686d2f33b6 /maintainers
parentd5371eb0295229a5949b795e7df59ebd2e16c67e (diff)
downloadnixpkgs-5eb2804cdbc5d288bebc534066577e7e1bff2409.tar
nixpkgs-5eb2804cdbc5d288bebc534066577e7e1bff2409.tar.gz
nixpkgs-5eb2804cdbc5d288bebc534066577e7e1bff2409.tar.bz2
nixpkgs-5eb2804cdbc5d288bebc534066577e7e1bff2409.tar.lz
nixpkgs-5eb2804cdbc5d288bebc534066577e7e1bff2409.tar.xz
nixpkgs-5eb2804cdbc5d288bebc534066577e7e1bff2409.tar.zst
nixpkgs-5eb2804cdbc5d288bebc534066577e7e1bff2409.zip
copy-tarballs.pl: Create redirects before uploading file
This makes the script more robust to interruption.
Diffstat (limited to 'maintainers')
-rwxr-xr-xmaintainers/scripts/copy-tarballs.pl12
1 files changed, 6 insertions, 6 deletions
diff --git a/maintainers/scripts/copy-tarballs.pl b/maintainers/scripts/copy-tarballs.pl
index 0098061d0f8..b1233827ad8 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;