reexport RemoteClass from Remote for cleanliness
This commit is contained in:
parent
0d83d17f04
commit
48418cb92b
3 changed files with 19 additions and 9 deletions
|
@ -21,7 +21,6 @@ import Data.String.Utils
|
||||||
import BackendClass
|
import BackendClass
|
||||||
import LocationLog
|
import LocationLog
|
||||||
import qualified Remote
|
import qualified Remote
|
||||||
import qualified RemoteClass
|
|
||||||
import qualified GitRepo as Git
|
import qualified GitRepo as Git
|
||||||
import Content
|
import Content
|
||||||
import qualified Annex
|
import qualified Annex
|
||||||
|
@ -74,16 +73,16 @@ copyKeyFile key file = do
|
||||||
-- This check is to avoid an ugly message if a remote is a
|
-- This check is to avoid an ugly message if a remote is a
|
||||||
-- drive that is not mounted.
|
-- drive that is not mounted.
|
||||||
probablyPresent r =
|
probablyPresent r =
|
||||||
if RemoteClass.hasKeyCheap r
|
if Remote.hasKeyCheap r
|
||||||
then do
|
then do
|
||||||
res <- RemoteClass.hasKey r key
|
res <- Remote.hasKey r key
|
||||||
case res of
|
case res of
|
||||||
Right b -> return b
|
Right b -> return b
|
||||||
Left _ -> return False
|
Left _ -> return False
|
||||||
else return True
|
else return True
|
||||||
docopy r continue = do
|
docopy r continue = do
|
||||||
showNote $ "copying from " ++ RemoteClass.name r ++ "..."
|
showNote $ "copying from " ++ Remote.name r ++ "..."
|
||||||
copied <- RemoteClass.retrieveKeyFile r key file
|
copied <- Remote.retrieveKeyFile r key file
|
||||||
if copied
|
if copied
|
||||||
then return True
|
then return True
|
||||||
else continue
|
else continue
|
||||||
|
@ -109,9 +108,9 @@ checkRemoveKey key numcopiesM = do
|
||||||
findcopies need have (r:rs) bad
|
findcopies need have (r:rs) bad
|
||||||
| length have >= need = return True
|
| length have >= need = return True
|
||||||
| otherwise = do
|
| otherwise = do
|
||||||
let u = RemoteClass.uuid r
|
let u = Remote.uuid r
|
||||||
let dup = u `elem` have
|
let dup = u `elem` have
|
||||||
haskey <- (RemoteClass.hasKey r) key
|
haskey <- Remote.hasKey r key
|
||||||
case (dup, haskey) of
|
case (dup, haskey) of
|
||||||
(False, Right True) -> findcopies need (u:have) rs bad
|
(False, Right True) -> findcopies need (u:have) rs bad
|
||||||
(False, Left _) -> findcopies need have rs (r: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 [] us = "Also these untrusted repositories may contain the file:\n" ++ us
|
||||||
message rs us = message rs [] ++ message [] us
|
message rs us = message rs [] ++ message [] us
|
||||||
|
|
||||||
showTriedRemotes :: [RemoteClass.Remote Annex] -> Annex ()
|
showTriedRemotes :: [Remote.Remote Annex] -> Annex ()
|
||||||
showTriedRemotes [] = return ()
|
showTriedRemotes [] = return ()
|
||||||
showTriedRemotes remotes =
|
showTriedRemotes remotes =
|
||||||
showLongNote $ "Unable to access these remotes: " ++
|
showLongNote $ "Unable to access these remotes: " ++
|
||||||
(join ", " $ map RemoteClass.name remotes)
|
(join ", " $ map Remote.name remotes)
|
||||||
|
|
||||||
getNumCopies :: Maybe Int -> Annex Int
|
getNumCopies :: Maybe Int -> Annex Int
|
||||||
getNumCopies (Just n) = return n
|
getNumCopies (Just n) = return n
|
||||||
|
|
|
@ -6,6 +6,15 @@
|
||||||
-}
|
-}
|
||||||
|
|
||||||
module Remote (
|
module Remote (
|
||||||
|
Remote,
|
||||||
|
uuid,
|
||||||
|
name,
|
||||||
|
storeKey,
|
||||||
|
retrieveKeyFile,
|
||||||
|
removeKey,
|
||||||
|
hasKey,
|
||||||
|
hasKeyCheap,
|
||||||
|
|
||||||
byName,
|
byName,
|
||||||
nameToUUID,
|
nameToUUID,
|
||||||
keyPossibilities,
|
keyPossibilities,
|
||||||
|
|
|
@ -1,4 +1,6 @@
|
||||||
{- git-annex remotes class
|
{- git-annex remotes class
|
||||||
|
-
|
||||||
|
- Most things should not need this, using Remote instead
|
||||||
-
|
-
|
||||||
- Copyright 2011 Joey Hess <joey@kitenet.net>
|
- Copyright 2011 Joey Hess <joey@kitenet.net>
|
||||||
-
|
-
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue