summaryrefslogtreecommitdiff
path: root/Assistant/MakeRemote.hs
diff options
context:
space:
mode:
authorGravatar Joey Hess <joey@kitenet.net>2013-10-01 16:08:01 -0400
committerGravatar Joey Hess <joey@kitenet.net>2013-10-01 16:08:01 -0400
commit74e81cb84305f97c3b66f0f52ec51109de1d355e (patch)
tree21f6e0fe4002204073e2389a64e77ab52dbfc44e /Assistant/MakeRemote.hs
parentda2a94862d24edf7f63e59c9797c054db556a53a (diff)
enabling ssh gcrypt now works
Diffstat (limited to 'Assistant/MakeRemote.hs')
-rw-r--r--Assistant/MakeRemote.hs20
1 files changed, 1 insertions, 19 deletions
diff --git a/Assistant/MakeRemote.hs b/Assistant/MakeRemote.hs
index d85bf0fd7..32a3fd6f5 100644
--- a/Assistant/MakeRemote.hs
+++ b/Assistant/MakeRemote.hs
@@ -24,34 +24,16 @@ import Creds
import Assistant.Gpg
import Utility.Gpg (KeyId)
-import qualified Data.Text as T
import qualified Data.Map as M
{- Sets up a new git or rsync remote, accessed over ssh. -}
makeSshRemote :: SshData -> Annex RemoteName
-makeSshRemote sshdata = maker (sshRepoName sshdata) (sshUrl sshdata)
+makeSshRemote sshdata = maker (sshRepoName sshdata) (genSshUrl sshdata)
where
maker
| onlyCapability sshdata RsyncCapable = makeRsyncRemote
| otherwise = makeGitRemote
-{- Generates a ssh or rsync url from a SshData. -}
-sshUrl :: SshData -> String
-sshUrl sshdata = addtrailingslash $ T.unpack $ T.concat $
- if (onlyCapability sshdata RsyncCapable)
- then [u, h, T.pack ":", sshDirectory sshdata]
- else [T.pack "ssh://", u, h, d]
- where
- u = maybe (T.pack "") (\v -> T.concat [v, T.pack "@"]) $ sshUserName sshdata
- h = sshHostName sshdata
- d
- | T.pack "/" `T.isPrefixOf` sshDirectory sshdata = sshDirectory sshdata
- | T.pack "~/" `T.isPrefixOf` sshDirectory sshdata = T.concat [T.pack "/", sshDirectory sshdata]
- | otherwise = T.concat [T.pack "/~/", sshDirectory sshdata]
- addtrailingslash s
- | "/" `isSuffixOf` s = s
- | otherwise = s ++ "/"
-
{- Runs an action that returns a name of the remote, and finishes adding it. -}
addRemote :: Annex RemoteName -> Annex Remote
addRemote a = do