diff options
author | Joey Hess <joey@kitenet.net> | 2011-12-31 04:11:39 -0400 |
---|---|---|
committer | Joey Hess <joey@kitenet.net> | 2011-12-31 04:11:58 -0400 |
commit | 4a02c2ea629e1825c824bcc09449806b12408699 (patch) | |
tree | fc00de3f710c2e2b2bbc6d4f99d576158648eb0b /Remote | |
parent | a2ec2d3760f5ae17836ade3b0238dde7f9de5bd2 (diff) |
type alias cleanup
Diffstat (limited to 'Remote')
-rw-r--r-- | Remote/Bup.hs | 4 | ||||
-rw-r--r-- | Remote/Directory.hs | 4 | ||||
-rw-r--r-- | Remote/Git.hs | 4 | ||||
-rw-r--r-- | Remote/Helper/Encryptable.hs | 4 | ||||
-rw-r--r-- | Remote/Hook.hs | 4 | ||||
-rw-r--r-- | Remote/Rsync.hs | 4 | ||||
-rw-r--r-- | Remote/S3real.hs | 26 | ||||
-rw-r--r-- | Remote/S3stub.hs | 2 | ||||
-rw-r--r-- | Remote/Web.hs | 4 |
9 files changed, 28 insertions, 28 deletions
diff --git a/Remote/Bup.hs b/Remote/Bup.hs index 9311d18e5..04cd49026 100644 --- a/Remote/Bup.hs +++ b/Remote/Bup.hs @@ -26,7 +26,7 @@ import Crypto type BupRepo = String -remote :: RemoteType Annex +remote :: RemoteType remote = RemoteType { typename = "bup", enumerate = findSpecialRemotes "buprepo", @@ -34,7 +34,7 @@ remote = RemoteType { setup = bupSetup } -gen :: Git.Repo -> UUID -> Maybe RemoteConfig -> Annex (Remote Annex) +gen :: Git.Repo -> UUID -> Maybe RemoteConfig -> Annex Remote gen r u c = do buprepo <- getConfig r "buprepo" (error "missing buprepo") cst <- remoteCost r (if bupLocal buprepo then semiCheapRemoteCost else expensiveRemoteCost) diff --git a/Remote/Directory.hs b/Remote/Directory.hs index e1b17c241..8ca2a2875 100644 --- a/Remote/Directory.hs +++ b/Remote/Directory.hs @@ -20,7 +20,7 @@ import Remote.Helper.Special import Remote.Helper.Encryptable import Crypto -remote :: RemoteType Annex +remote :: RemoteType remote = RemoteType { typename = "directory", enumerate = findSpecialRemotes "directory", @@ -28,7 +28,7 @@ remote = RemoteType { setup = directorySetup } -gen :: Git.Repo -> UUID -> Maybe RemoteConfig -> Annex (Remote Annex) +gen :: Git.Repo -> UUID -> Maybe RemoteConfig -> Annex Remote gen r u c = do dir <- getConfig r "directory" (error "missing directory") cst <- remoteCost r cheapRemoteCost diff --git a/Remote/Git.hs b/Remote/Git.hs index 2f2be5bee..e790d01a7 100644 --- a/Remote/Git.hs +++ b/Remote/Git.hs @@ -28,7 +28,7 @@ import Utility.TempFile import Config import Init -remote :: RemoteType Annex +remote :: RemoteType remote = RemoteType { typename = "git", enumerate = list, @@ -50,7 +50,7 @@ list = do Git.Construct.remoteNamed n $ Git.Construct.fromRemoteLocation url g -gen :: Git.Repo -> UUID -> Maybe RemoteConfig -> Annex (Remote Annex) +gen :: Git.Repo -> UUID -> Maybe RemoteConfig -> Annex Remote gen r u _ = do {- It's assumed to be cheap to read the config of non-URL remotes, - so this is done each time git-annex is run. Conversely, diff --git a/Remote/Helper/Encryptable.hs b/Remote/Helper/Encryptable.hs index 99f48fe7b..3abea7bc6 100644 --- a/Remote/Helper/Encryptable.hs +++ b/Remote/Helper/Encryptable.hs @@ -41,8 +41,8 @@ encryptableRemote :: Maybe RemoteConfig -> ((Cipher, Key) -> Key -> Annex Bool) -> ((Cipher, Key) -> FilePath -> Annex Bool) - -> Remote Annex - -> Remote Annex + -> Remote + -> Remote encryptableRemote c storeKeyEncrypted retrieveKeyFileEncrypted r = r { storeKey = store, diff --git a/Remote/Hook.hs b/Remote/Hook.hs index 08be1a0ee..6c4a044ac 100644 --- a/Remote/Hook.hs +++ b/Remote/Hook.hs @@ -20,7 +20,7 @@ import Remote.Helper.Special import Remote.Helper.Encryptable import Crypto -remote :: RemoteType Annex +remote :: RemoteType remote = RemoteType { typename = "hook", enumerate = findSpecialRemotes "hooktype", @@ -28,7 +28,7 @@ remote = RemoteType { setup = hookSetup } -gen :: Git.Repo -> UUID -> Maybe RemoteConfig -> Annex (Remote Annex) +gen :: Git.Repo -> UUID -> Maybe RemoteConfig -> Annex Remote gen r u c = do hooktype <- getConfig r "hooktype" (error "missing hooktype") cst <- remoteCost r expensiveRemoteCost diff --git a/Remote/Rsync.hs b/Remote/Rsync.hs index 91a72e88e..2fe302ba5 100644 --- a/Remote/Rsync.hs +++ b/Remote/Rsync.hs @@ -27,7 +27,7 @@ data RsyncOpts = RsyncOpts { rsyncOptions :: [CommandParam] } -remote :: RemoteType Annex +remote :: RemoteType remote = RemoteType { typename = "rsync", enumerate = findSpecialRemotes "rsyncurl", @@ -35,7 +35,7 @@ remote = RemoteType { setup = rsyncSetup } -gen :: Git.Repo -> UUID -> Maybe RemoteConfig -> Annex (Remote Annex) +gen :: Git.Repo -> UUID -> Maybe RemoteConfig -> Annex Remote gen r u c = do o <- genRsyncOpts r cst <- remoteCost r expensiveRemoteCost diff --git a/Remote/S3real.hs b/Remote/S3real.hs index 23a589726..bef89b553 100644 --- a/Remote/S3real.hs +++ b/Remote/S3real.hs @@ -28,7 +28,7 @@ import Crypto import Annex.Content import Utility.Base64 -remote :: RemoteType Annex +remote :: RemoteType remote = RemoteType { typename = "S3", enumerate = findSpecialRemotes "s3", @@ -36,11 +36,11 @@ remote = RemoteType { setup = s3Setup } -gen :: Git.Repo -> UUID -> Maybe RemoteConfig -> Annex (Remote Annex) +gen :: Git.Repo -> UUID -> Maybe RemoteConfig -> Annex Remote gen r u c = do cst <- remoteCost r expensiveRemoteCost return $ gen' r u c cst -gen' :: Git.Repo -> UUID -> Maybe RemoteConfig -> Int -> Remote Annex +gen' :: Git.Repo -> UUID -> Maybe RemoteConfig -> Int -> Remote gen' r u c cst = encryptableRemote c (storeEncrypted this) @@ -111,13 +111,13 @@ s3Setup u c = handlehost $ M.lookup "host" c -- be human-readable M.delete "bucket" defaults -store :: Remote Annex -> Key -> Annex Bool +store :: Remote -> Key -> Annex Bool store r k = s3Action r False $ \(conn, bucket) -> do dest <- inRepo $ gitAnnexLocation k res <- liftIO $ storeHelper (conn, bucket) r k dest s3Bool res -storeEncrypted :: Remote Annex -> (Cipher, Key) -> Key -> Annex Bool +storeEncrypted :: Remote -> (Cipher, Key) -> Key -> Annex Bool storeEncrypted r (cipher, enck) k = s3Action r False $ \(conn, bucket) -> -- To get file size of the encrypted content, have to use a temp file. -- (An alternative would be chunking to to a constant size.) @@ -127,7 +127,7 @@ storeEncrypted r (cipher, enck) k = s3Action r False $ \(conn, bucket) -> res <- liftIO $ storeHelper (conn, bucket) r enck tmp s3Bool res -storeHelper :: (AWSConnection, String) -> Remote Annex -> Key -> FilePath -> IO (AWSResult ()) +storeHelper :: (AWSConnection, String) -> Remote -> Key -> FilePath -> IO (AWSResult ()) storeHelper (conn, bucket) r k file = do content <- liftIO $ L.readFile file -- size is provided to S3 so the whole content does not need to be @@ -149,7 +149,7 @@ storeHelper (conn, bucket) r k file = do xheaders = filter isxheader $ M.assocs $ fromJust $ config r isxheader (h, _) = "x-amz-" `isPrefixOf` h -retrieve :: Remote Annex -> Key -> FilePath -> Annex Bool +retrieve :: Remote -> Key -> FilePath -> Annex Bool retrieve r k f = s3Action r False $ \(conn, bucket) -> do res <- liftIO $ getObject conn $ bucketKey r bucket k case res of @@ -158,7 +158,7 @@ retrieve r k f = s3Action r False $ \(conn, bucket) -> do return True Left e -> s3Warning e -retrieveEncrypted :: Remote Annex -> (Cipher, Key) -> FilePath -> Annex Bool +retrieveEncrypted :: Remote -> (Cipher, Key) -> FilePath -> Annex Bool retrieveEncrypted r (cipher, enck) f = s3Action r False $ \(conn, bucket) -> do res <- liftIO $ getObject conn $ bucketKey r bucket enck case res of @@ -168,12 +168,12 @@ retrieveEncrypted r (cipher, enck) f = s3Action r False $ \(conn, bucket) -> do return True Left e -> s3Warning e -remove :: Remote Annex -> Key -> Annex Bool +remove :: Remote -> Key -> Annex Bool remove r k = s3Action r False $ \(conn, bucket) -> do res <- liftIO $ deleteObject conn $ bucketKey r bucket k s3Bool res -checkPresent :: Remote Annex -> Key -> Annex (Either String Bool) +checkPresent :: Remote -> Key -> Annex (Either String Bool) checkPresent r k = s3Action r noconn $ \(conn, bucket) -> do showAction $ "checking " ++ name r res <- liftIO $ getObjectInfo conn $ bucketKey r bucket k @@ -196,7 +196,7 @@ s3Bool :: AWSResult () -> Annex Bool s3Bool (Right _) = return True s3Bool (Left e) = s3Warning e -s3Action :: Remote Annex -> a -> ((AWSConnection, String) -> Annex a) -> Annex a +s3Action :: Remote -> a -> ((AWSConnection, String) -> Annex a) -> Annex a s3Action r noconn action = do when (isNothing $ config r) $ error $ "Missing configuration for special remote " ++ name r @@ -206,14 +206,14 @@ s3Action r noconn action = do (Just b, Just c) -> action (c, b) _ -> return noconn -bucketFile :: Remote Annex -> Key -> FilePath +bucketFile :: Remote -> Key -> FilePath bucketFile r = munge . show where munge s = case M.lookup "mungekeys" $ fromJust $ config r of Just "ia" -> iaMunge s _ -> s -bucketKey :: Remote Annex -> String -> Key -> S3Object +bucketKey :: Remote -> String -> Key -> S3Object bucketKey r bucket k = S3Object bucket (bucketFile r k) "" [] L.empty {- Internet Archive limits filenames to a subset of ascii, diff --git a/Remote/S3stub.hs b/Remote/S3stub.hs index d91a222e8..31e8a339e 100644 --- a/Remote/S3stub.hs +++ b/Remote/S3stub.hs @@ -4,7 +4,7 @@ module Remote.S3 (remote) where import Types.Remote import Types -remote :: RemoteType Annex +remote :: RemoteType remote = RemoteType { typename = "S3", enumerate = return [], diff --git a/Remote/Web.hs b/Remote/Web.hs index c0d54132a..93e5770f0 100644 --- a/Remote/Web.hs +++ b/Remote/Web.hs @@ -15,7 +15,7 @@ import Config import Logs.Web import qualified Utility.Url as Url -remote :: RemoteType Annex +remote :: RemoteType remote = RemoteType { typename = "web", enumerate = list, @@ -31,7 +31,7 @@ list = do r <- liftIO $ Git.Construct.remoteNamed "web" Git.Construct.fromUnknown return [r] -gen :: Git.Repo -> UUID -> Maybe RemoteConfig -> Annex (Remote Annex) +gen :: Git.Repo -> UUID -> Maybe RemoteConfig -> Annex Remote gen r _ _ = return Remote { uuid = webUUID, |