git-annex-shell now exclusively used for all remote access

This commit is contained in:
Joey Hess 2010-12-31 19:09:17 -04:00
parent 30e0065ab9
commit 700aed13cf
6 changed files with 102 additions and 125 deletions

View file

@ -7,8 +7,20 @@
module RsyncFile where
import Utility
import System.Posix.Process
import Data.String.Utils
import Utility
{- Generates parameters to make rsync use a specified command as its remote
- shell. -}
rsyncShell :: [String] -> [String]
rsyncShell command = ["-e", unwords $ map escape command]
where
{- rsync requires some weird, non-shell like quoting in
- here. A doubled single quote inside the single quoted
- string is a single quote. -}
escape s = "'" ++ (join "''" $ split "'" s) ++ "'"
{- Runs rsync in server mode to send a file, and exits. -}
rsyncServerSend :: FilePath -> IO ()