summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Joey Hess <joey@kitenet.net>2011-03-27 17:12:32 -0400
committerGravatar Joey Hess <joey@kitenet.net>2011-03-27 17:12:32 -0400
commit48418cb92bd2548d333350ac0b7bf2a04540d621 (patch)
treecb26b9567ce45aefdeab9f804901bb78ad081662
parent0d83d17f0455e664f06e3e46b994abadceb7b879 (diff)
reexport RemoteClass from Remote for cleanliness
-rw-r--r--Backend/File.hs17
-rw-r--r--Remote.hs9
-rw-r--r--RemoteClass.hs2
3 files changed, 19 insertions, 9 deletions
diff --git a/Backend/File.hs b/Backend/File.hs
index 9c102cf50..b86413e40 100644
--- a/Backend/File.hs
+++ b/Backend/File.hs
@@ -21,7 +21,6 @@ import Data.String.Utils
import BackendClass
import LocationLog
import qualified Remote
-import qualified RemoteClass
import qualified GitRepo as Git
import Content
import qualified Annex
@@ -74,16 +73,16 @@ copyKeyFile key file = do
-- This check is to avoid an ugly message if a remote is a
-- drive that is not mounted.
probablyPresent r =
- if RemoteClass.hasKeyCheap r
+ if Remote.hasKeyCheap r
then do
- res <- RemoteClass.hasKey r key
+ res <- Remote.hasKey r key
case res of
Right b -> return b
Left _ -> return False
else return True
docopy r continue = do
- showNote $ "copying from " ++ RemoteClass.name r ++ "..."
- copied <- RemoteClass.retrieveKeyFile r key file
+ showNote $ "copying from " ++ Remote.name r ++ "..."
+ copied <- Remote.retrieveKeyFile r key file
if copied
then return True
else continue
@@ -109,9 +108,9 @@ checkRemoveKey key numcopiesM = do
findcopies need have (r:rs) bad
| length have >= need = return True
| otherwise = do
- let u = RemoteClass.uuid r
+ let u = Remote.uuid r
let dup = u `elem` have
- haskey <- (RemoteClass.hasKey r) key
+ haskey <- Remote.hasKey r key
case (dup, haskey) of
(False, Right True) -> findcopies need (u:have) rs bad
(False, Left _) -> findcopies need have rs (r:bad)
@@ -147,11 +146,11 @@ showLocations key exclude = do
message [] us = "Also these untrusted repositories may contain the file:\n" ++ us
message rs us = message rs [] ++ message [] us
-showTriedRemotes :: [RemoteClass.Remote Annex] -> Annex ()
+showTriedRemotes :: [Remote.Remote Annex] -> Annex ()
showTriedRemotes [] = return ()
showTriedRemotes remotes =
showLongNote $ "Unable to access these remotes: " ++
- (join ", " $ map RemoteClass.name remotes)
+ (join ", " $ map Remote.name remotes)
getNumCopies :: Maybe Int -> Annex Int
getNumCopies (Just n) = return n
diff --git a/Remote.hs b/Remote.hs
index 64ad85d62..1d9a828d5 100644
--- a/Remote.hs
+++ b/Remote.hs
@@ -6,6 +6,15 @@
-}
module Remote (
+ Remote,
+ uuid,
+ name,
+ storeKey,
+ retrieveKeyFile,
+ removeKey,
+ hasKey,
+ hasKeyCheap,
+
byName,
nameToUUID,
keyPossibilities,
diff --git a/RemoteClass.hs b/RemoteClass.hs
index 9fef0e44a..38e8407a5 100644
--- a/RemoteClass.hs
+++ b/RemoteClass.hs
@@ -1,5 +1,7 @@
{- git-annex remotes class
-
+ - Most things should not need this, using Remote instead
+ -
- Copyright 2011 Joey Hess <joey@kitenet.net>
-
- Licensed under the GNU GPL version 3 or higher.