aboutsummaryrefslogtreecommitdiff
path: root/Remote
diff options
context:
space:
mode:
authorGravatar Joey Hess <joey@kitenet.net>2011-03-29 14:55:59 -0400
committerGravatar Joey Hess <joey@kitenet.net>2011-03-29 14:55:59 -0400
commit0a4c610b4fd78f7d1589117cb723d7d8c15c120c (patch)
tree21682bc0b6314d1f47b539cbecbd80794fed2020 /Remote
parent05751d55cd8002e6a2a2afc520622fb6697472e3 (diff)
initremote works
Diffstat (limited to 'Remote')
-rw-r--r--Remote/Git.hs9
-rw-r--r--Remote/S3.hs13
2 files changed, 16 insertions, 6 deletions
diff --git a/Remote/Git.hs b/Remote/Git.hs
index b686e47af..2d7a0c8ff 100644
--- a/Remote/Git.hs
+++ b/Remote/Git.hs
@@ -31,7 +31,11 @@ import Ssh
import Config
remote :: RemoteType Annex
-remote = RemoteType { typename = "git", generator = gen }
+remote = RemoteType {
+ typename = "git",
+ generator = gen,
+ setup = error "not supported"
+}
gen :: Annex (RemoteGenerator Annex)
gen = do
@@ -68,8 +72,7 @@ genRemote r = do
removeKey = dropKey r,
hasKey = inAnnex r,
hasKeyCheap = not (Git.repoIsUrl r),
- config = Nothing,
- setup = \_ -> return ()
+ config = Nothing
}
{- Tries to read the config for a specified remote, updates state, and
diff --git a/Remote/S3.hs b/Remote/S3.hs
index 7971faa8f..489114b12 100644
--- a/Remote/S3.hs
+++ b/Remote/S3.hs
@@ -28,7 +28,11 @@ import UUID
import Config
remote :: RemoteType Annex
-remote = RemoteType { typename = "S3", generator = gen }
+remote = RemoteType {
+ typename = "S3",
+ generator = gen,
+ setup = s3Setup
+}
gen :: Annex (RemoteGenerator Annex)
gen = do
@@ -68,8 +72,7 @@ genRemote r u = do
removeKey = error "TODO",
hasKey = error "TODO",
hasKeyCheap = False,
- config = Nothing,
- setup = \_ -> return ()
+ config = Nothing
}
s3Connection :: Git.Repo -> Annex (Maybe AWSConnection)
@@ -102,6 +105,10 @@ getS3Config r s def = do
where
envvar = "ANNEX_" ++ map (\c -> if c == '-' then '_' else toUpper c) s
+s3Setup :: UUID -> M.Map String String -> Annex (M.Map String String)
+s3Setup u c = do
+ return c
+
{- The UUID of a S3 bucket is stored in a file "git-annex-uuid" in the
- bucket. Gets the UUID, or if there is none, sets a new UUID, possibly
- also creating the bucket. -}