diff options
author | 2013-10-01 13:43:35 -0400 | |
---|---|---|
committer | 2013-10-01 13:43:35 -0400 | |
commit | 8cc8977ecce88853d2fa185e2372c412308b112f (patch) | |
tree | 328f00df9f8a0924d539fac76e84aa7186ae50ca /Assistant/MakeRemote.hs | |
parent | 80333594c4c06839af4fe109e2dac8a7481adea3 (diff) |
webapp can now set up gcrypt repos on ssh servers
Diffstat (limited to 'Assistant/MakeRemote.hs')
-rw-r--r-- | Assistant/MakeRemote.hs | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/Assistant/MakeRemote.hs b/Assistant/MakeRemote.hs index 1880d519e..d85bf0fd7 100644 --- a/Assistant/MakeRemote.hs +++ b/Assistant/MakeRemote.hs @@ -27,20 +27,18 @@ import Utility.Gpg (KeyId) import qualified Data.Text as T import qualified Data.Map as M -{- Sets up a new ssh or rsync remote. -} -makeSshRemote :: Bool -> SshData -> Annex RemoteName -makeSshRemote forcersync sshdata = - maker (sshRepoName sshdata) (sshUrl forcersync sshdata) +{- Sets up a new git or rsync remote, accessed over ssh. -} +makeSshRemote :: SshData -> Annex RemoteName +makeSshRemote sshdata = maker (sshRepoName sshdata) (sshUrl sshdata) where - rsync = forcersync || sshCapabilities sshdata == [RsyncCapable] maker - | rsync = makeRsyncRemote + | onlyCapability sshdata RsyncCapable = makeRsyncRemote | otherwise = makeGitRemote {- Generates a ssh or rsync url from a SshData. -} -sshUrl :: Bool -> SshData -> String -sshUrl forcersync sshdata = addtrailingslash $ T.unpack $ T.concat $ - if (forcersync || sshCapabilities sshdata == [RsyncCapable]) +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 |