git-annex-shell now exclusively used for all remote access
This commit is contained in:
parent
30e0065ab9
commit
700aed13cf
6 changed files with 102 additions and 125 deletions
14
RsyncFile.hs
14
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 ()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue