From 0bd7ebbf356c2753fbd6e29b925efef0b4eb3f74 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Sun, 31 Oct 2010 23:50:58 -0400 Subject: make a ssh call honor annex-ssh-options --- Remotes.hs | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) (limited to 'Remotes.hs') 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] -- cgit v1.2.3