summaryrefslogtreecommitdiff
path: root/Remote
diff options
context:
space:
mode:
authorGravatar Joey Hess <joey@kitenet.net>2012-01-05 23:10:19 -0400
committerGravatar Joey Hess <joey@kitenet.net>2012-01-05 23:11:07 -0400
commitc371c40a889c73b79f7f8918b2918e2fbb75f212 (patch)
tree0d81d0541c465afd04317c237861d364d42171e9 /Remote
parentad43f0362688a601ba43f462e80f5a91bf398c02 (diff)
Don't list S3 as a remote type when built without S3 support.
Diffstat (limited to 'Remote')
-rw-r--r--Remote/S3real.hs6
-rw-r--r--Remote/S3stub.hs10
2 files changed, 5 insertions, 11 deletions
diff --git a/Remote/S3real.hs b/Remote/S3real.hs
index bef89b553..96a831e34 100644
--- a/Remote/S3real.hs
+++ b/Remote/S3real.hs
@@ -28,8 +28,8 @@ import Crypto
import Annex.Content
import Utility.Base64
-remote :: RemoteType
-remote = RemoteType {
+remote :: Maybe RemoteType
+remote = Just $ RemoteType {
typename = "S3",
enumerate = findSpecialRemotes "s3",
generate = gen,
@@ -58,7 +58,7 @@ gen' r u c cst =
hasKeyCheap = False,
config = c,
repo = r,
- remotetype = remote
+ remotetype = fromJust remote
}
s3Setup :: UUID -> RemoteConfig -> Annex RemoteConfig
diff --git a/Remote/S3stub.hs b/Remote/S3stub.hs
index 31e8a339e..5bd2b1c79 100644
--- a/Remote/S3stub.hs
+++ b/Remote/S3stub.hs
@@ -1,13 +1,7 @@
-- stub for when hS3 is not available
module Remote.S3 (remote) where
-import Types.Remote
import Types
-remote :: RemoteType
-remote = RemoteType {
- typename = "S3",
- enumerate = return [],
- generate = error "S3 not enabled",
- setup = error "S3 not enabled"
-}
+remote :: Maybe RemoteType
+remote = Nothing