summaryrefslogtreecommitdiff
path: root/Remote
diff options
context:
space:
mode:
authorGravatar Joey Hess <joeyh@joeyh.name>2015-04-23 14:16:53 -0400
committerGravatar Joey Hess <joeyh@joeyh.name>2015-04-23 14:16:53 -0400
commit060e698c88fefab5a55e99d5d8a45897fc1571ac (patch)
tree1082aef6219e9eaf22c538d3cdba92328501dc1b /Remote
parent8fb9ed4c74ecd332a1d2c8219cd3429b78053b0b (diff)
S3: git annex enableremote will not create a bucket name, which failed since the bucket already exists.
Diffstat (limited to 'Remote')
-rw-r--r--Remote/S3.hs9
1 files changed, 5 insertions, 4 deletions
diff --git a/Remote/S3.hs b/Remote/S3.hs
index cf46c2b28..d290f9596 100644
--- a/Remote/S3.hs
+++ b/Remote/S3.hs
@@ -98,9 +98,9 @@ gen r u c gc = do
s3Setup :: Maybe UUID -> Maybe CredPair -> RemoteConfig -> Annex (RemoteConfig, UUID)
s3Setup mu mcreds c = do
u <- maybe (liftIO genUUID) return mu
- s3Setup' u mcreds c
-s3Setup' :: UUID -> Maybe CredPair -> RemoteConfig -> Annex (RemoteConfig, UUID)
-s3Setup' u mcreds c = if configIA c then archiveorg else defaulthost
+ s3Setup' (isNothing mu) u mcreds c
+s3Setup' :: Bool -> UUID -> Maybe CredPair -> RemoteConfig -> Annex (RemoteConfig, UUID)
+s3Setup' new u mcreds c = if configIA c then archiveorg else defaulthost
where
remotename = fromJust (M.lookup "name" c)
defbucket = remotename ++ "-" ++ fromUUID u
@@ -120,7 +120,8 @@ s3Setup' u mcreds c = if configIA c then archiveorg else defaulthost
(c', encsetup) <- encryptionSetup c
c'' <- setRemoteCredPair encsetup c' (AWS.creds u) mcreds
let fullconfig = c'' `M.union` defaults
- genBucket fullconfig u
+ when new $
+ genBucket fullconfig u
use fullconfig
archiveorg = do