allow enabling existing S3 repos

This commit is contained in:
Joey Hess 2012-09-26 15:24:23 -04:00
parent 17708dd173
commit c2c577f34f
5 changed files with 93 additions and 33 deletions

View file

@ -58,7 +58,7 @@ addRemote a = do
{- Inits a rsync special remote, and returns its name. -}
makeRsyncRemote :: String -> String -> Annex String
makeRsyncRemote name location = makeRemote name location $
const $ void $ makeSpecialRemote name Rsync.remote config
const $ makeSpecialRemote name Rsync.remote config
where
config = M.fromList
[ ("encryption", "shared")
@ -66,14 +66,13 @@ makeRsyncRemote name location = makeRemote name location $
, ("type", "rsync")
]
{- Inits a special remote, and returns its name. -}
makeSpecialRemote :: String -> RemoteType -> R.RemoteConfig -> Annex String
{- Inits a special remote. -}
makeSpecialRemote :: String -> RemoteType -> R.RemoteConfig -> Annex ()
makeSpecialRemote name remotetype config = do
(u, c) <- Command.InitRemote.findByName name
c' <- R.setup remotetype u $ M.union config c
describeUUID u name
configSet u c'
return name
{- Returns the name of the git remote it created. If there's already a
- remote at the location, returns its name. -}