S3 export finalization

Fixed ACL issue, and updated some documentation.
This commit is contained in:
Joey Hess 2017-09-08 16:19:38 -04:00
parent 44cd5ae313
commit 650d0955a0
No known key found for this signature in database
GPG key ID: DB12DB0FF05F8F38
10 changed files with 120 additions and 80 deletions

View file

@ -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