From 4e44bd5314174c2e71d93d124ec5067052f2ec56 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Fri, 8 Sep 2017 16:19:38 -0400 Subject: S3 export finalization Fixed ACL issue, and updated some documentation. --- Remote/S3.hs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'Remote') diff --git a/Remote/S3.hs b/Remote/S3.hs index 96d24d00e..f80a08bb2 100644 --- a/Remote/S3.hs +++ b/Remote/S3.hs @@ -357,14 +357,16 @@ checkPresentExportS3 r info _k loc = go = withS3Handle (config r) (gitconfig r) (uuid r) $ \h -> do checkKeyHelper info h (T.pack $ bucketExportLocation info loc) +-- S3 has no move primitive; copy and delete. renameExportS3 :: Remote -> S3Info -> Key -> ExportLocation -> ExportLocation -> Annex Bool renameExportS3 r info _k src dest = catchNonAsync go (\e -> warning (show e) >> return False) where go = withS3Handle (config r) (gitconfig r) (uuid r) $ \h -> do - -- S3 has no move primitive; copy and delete. - void $ sendS3Handle h $ S3.copyObject (bucket info) dstobject + let co = S3.copyObject (bucket info) dstobject (S3.ObjectId (bucket info) srcobject Nothing) S3.CopyMetadata + -- ACL is not preserved by copy. + void $ sendS3Handle h $ co { S3.coAcl = acl info } void $ sendS3Handle h $ S3.DeleteObject srcobject (bucket info) return True srcobject = T.pack $ bucketExportLocation info src -- cgit v1.2.3