diff options
author | Joey Hess <joey@kitenet.net> | 2010-10-31 23:50:58 -0400 |
---|---|---|
committer | Joey Hess <joey@kitenet.net> | 2010-10-31 23:50:58 -0400 |
commit | 0bd7ebbf356c2753fbd6e29b925efef0b4eb3f74 (patch) | |
tree | e7288bd535d3dbc294f1c5bfdb90fff60b9f01c9 /Remotes.hs | |
parent | cec25153ecd4f824cf150afbd294ad0c5ed1413e (diff) |
make a ssh call honor annex-ssh-options
Diffstat (limited to 'Remotes.hs')
-rw-r--r-- | Remotes.hs | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/Remotes.hs b/Remotes.hs index dffbe8f50..c28ba5afe 100644 --- a/Remotes.hs +++ b/Remotes.hs @@ -84,21 +84,21 @@ keyPossibilities key = do inAnnex :: Git.Repo -> Key -> Annex (Either IOException Bool) inAnnex r key = do if (not $ Git.repoIsUrl r) - then check local - else do - Core.showNote ("checking " ++ Git.repoDescribe r ++ "...") - check remote + then liftIO $ ((try checklocal)::IO (Either IOException Bool)) + else checkremote where - check a = liftIO $ ((try a)::IO (Either IOException Bool)) - local = do + checklocal = do -- run a local check by making an Annex monad -- using the remote a <- Annex.new r [] Annex.eval a (Core.inAnnex key) - remote = do - -- remote check via ssh in and test - boolSystem "ssh" [Git.urlHost r, "test -e " ++ - (shellEscape $ annexLocation r key)] + checkremote = do + Core.showNote ("checking " ++ Git.repoDescribe r ++ "...") + inannex <- runCmd r ("test -e " ++ + (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. -} remotesByCost :: Annex [Git.Repo] |