diff options
author | Joey Hess <joey@kitenet.net> | 2010-12-31 19:09:17 -0400 |
---|---|---|
committer | Joey Hess <joey@kitenet.net> | 2010-12-31 19:09:17 -0400 |
commit | 700aed13cff27f9315df1209e0cd37d5e51f5390 (patch) | |
tree | 4b28a2499293b1aea9cac2ac661a6bc68c319478 /RsyncFile.hs | |
parent | 30e0065ab97843f866a7fe095b8a18ee6eb4c321 (diff) |
git-annex-shell now exclusively used for all remote access
Diffstat (limited to 'RsyncFile.hs')
-rw-r--r-- | RsyncFile.hs | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/RsyncFile.hs b/RsyncFile.hs index 14f6dc926..274e66151 100644 --- a/RsyncFile.hs +++ b/RsyncFile.hs @@ -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 () |