make a ssh call honor annex-ssh-options
This commit is contained in:
parent
cec25153ec
commit
0bd7ebbf35
1 changed files with 10 additions and 10 deletions
20
Remotes.hs
20
Remotes.hs
|
@ -84,21 +84,21 @@ keyPossibilities key = do
|
||||||
inAnnex :: Git.Repo -> Key -> Annex (Either IOException Bool)
|
inAnnex :: Git.Repo -> Key -> Annex (Either IOException Bool)
|
||||||
inAnnex r key = do
|
inAnnex r key = do
|
||||||
if (not $ Git.repoIsUrl r)
|
if (not $ Git.repoIsUrl r)
|
||||||
then check local
|
then liftIO $ ((try checklocal)::IO (Either IOException Bool))
|
||||||
else do
|
else checkremote
|
||||||
Core.showNote ("checking " ++ Git.repoDescribe r ++ "...")
|
|
||||||
check remote
|
|
||||||
where
|
where
|
||||||
check a = liftIO $ ((try a)::IO (Either IOException Bool))
|
checklocal = do
|
||||||
local = do
|
|
||||||
-- run a local check by making an Annex monad
|
-- run a local check by making an Annex monad
|
||||||
-- using the remote
|
-- using the remote
|
||||||
a <- Annex.new r []
|
a <- Annex.new r []
|
||||||
Annex.eval a (Core.inAnnex key)
|
Annex.eval a (Core.inAnnex key)
|
||||||
remote = do
|
checkremote = do
|
||||||
-- remote check via ssh in and test
|
Core.showNote ("checking " ++ Git.repoDescribe r ++ "...")
|
||||||
boolSystem "ssh" [Git.urlHost r, "test -e " ++
|
inannex <- runCmd r ("test -e " ++
|
||||||
(shellEscape $ annexLocation r key)]
|
(shellEscape $ annexLocation r key)) []
|
||||||
|
-- XXX Note that ssh failing and the file not existing
|
||||||
|
-- are not currently differentiated.
|
||||||
|
return $ Right inannex
|
||||||
|
|
||||||
{- Cost Ordered list of remotes. -}
|
{- Cost Ordered list of remotes. -}
|
||||||
remotesByCost :: Annex [Git.Repo]
|
remotesByCost :: Annex [Git.Repo]
|
||||||
|
|
Loading…
Reference in a new issue