This commit is contained in:
Joey Hess 2011-03-28 23:51:07 -04:00
parent b1db436816
commit a3b6586902
4 changed files with 45 additions and 19 deletions

View file

@ -6,7 +6,7 @@
-}
module Remote.Git (
generate,
remote,
onRemote
) where
@ -30,8 +30,11 @@ import RsyncFile
import Ssh
import Config
generate :: Annex (RemoteGenerator Annex)
generate = do
remote :: RemoteType Annex
remote = RemoteType { typename = "git", generator = gen }
gen :: Annex (RemoteGenerator Annex)
gen = do
g <- Annex.gitRepo
allremotes <- filterM remoteNotIgnored $ Git.remotes g
@ -64,7 +67,10 @@ genRemote r = do
retrieveKeyFile = copyFromRemote r,
removeKey = dropKey r,
hasKey = inAnnex r,
hasKeyCheap = not (Git.repoIsUrl r)
hasKeyCheap = not (Git.repoIsUrl r),
hasConfig = False,
config = Nothing,
setup = \_ -> return ()
}
{- Tries to read the config for a specified remote, updates state, and

View file

@ -5,7 +5,7 @@
- Licensed under the GNU GPL version 3 or higher.
-}
module Remote.S3 (generate) where
module Remote.S3 (remote) where
import Network.AWS.AWSConnection
import Network.AWS.S3Object
@ -27,8 +27,11 @@ import qualified Annex
import UUID
import Config
generate :: Annex (RemoteGenerator Annex)
generate = do
remote :: RemoteType Annex
remote = RemoteType { typename = "S3", generator = gen }
gen :: Annex (RemoteGenerator Annex)
gen = do
g <- Annex.gitRepo
remotes <- filterM remoteNotIgnored $ findS3Remotes g
todo <- filterM cachedUUID remotes
@ -64,7 +67,10 @@ genRemote r u = do
retrieveKeyFile = error "TODO",
removeKey = error "TODO",
hasKey = error "TODO",
hasKeyCheap = False
hasKeyCheap = False,
hasConfig = True,
config = Nothing,
setup = \_ -> return ()
}
s3Connection :: Git.Repo -> Annex (Maybe AWSConnection)