diff options
author | Joey Hess <joey@kitenet.net> | 2011-10-03 22:24:57 -0400 |
---|---|---|
committer | Joey Hess <joey@kitenet.net> | 2011-10-03 23:29:48 -0400 |
commit | 8ef2095fa00408ce6729596a42bc0abdc7778098 (patch) | |
tree | d6fc3c9f9519ba2ce617a804ce1c5f33f59a9109 /Remote/Rsync.hs | |
parent | 003a604a6e48a8a0ffd1564e3399b54e8c673e92 (diff) |
factor out common imports
no code changes
Diffstat (limited to 'Remote/Rsync.hs')
-rw-r--r-- | Remote/Rsync.hs | 24 |
1 files changed, 5 insertions, 19 deletions
diff --git a/Remote/Rsync.hs b/Remote/Rsync.hs index 9d2d7ddcf..6a1c297c5 100644 --- a/Remote/Rsync.hs +++ b/Remote/Rsync.hs @@ -8,32 +8,18 @@ module Remote.Rsync (remote) where import qualified Data.ByteString.Lazy.Char8 as L -import Control.Exception.Extensible (IOException) import qualified Data.Map as M -import Control.Monad.State (liftIO) -import System.FilePath -import System.Directory -import System.Posix.Files -import System.Posix.Process -import Data.Maybe - -import Types + +import AnnexCommon import Types.Remote import qualified Git -import qualified Annex import UUID -import Locations import Config import Content -import Utility -import Utility.Conditional import Remote.Helper.Special import Remote.Helper.Encryptable import Crypto -import Messages import Utility.RsyncFile -import Utility.SafeCommand -import Utility.Path type RsyncUrl = String @@ -106,12 +92,12 @@ rsyncKeyDir o k = rsyncUrl o </> hashDirMixed k </> shellEscape (keyFile k) store :: RsyncOpts -> Key -> Annex Bool store o k = do - g <- Annex.gitRepo + g <- gitRepo rsyncSend o k (gitAnnexLocation g k) storeEncrypted :: RsyncOpts -> (Cipher, Key) -> Key -> Annex Bool storeEncrypted o (cipher, enck) k = withTmp enck $ \tmp -> do - g <- Annex.gitRepo + g <- gitRepo let f = gitAnnexLocation g k liftIO $ withEncryptedContent cipher (L.readFile f) $ \s -> L.writeFile tmp s rsyncSend o enck tmp @@ -166,7 +152,7 @@ partialParams = Params "--no-inplace --partial --partial-dir=.rsync-partial" - up trees for rsync. -} withRsyncScratchDir :: (FilePath -> Annex Bool) -> Annex Bool withRsyncScratchDir a = do - g <- Annex.gitRepo + g <- gitRepo pid <- liftIO getProcessID let tmp = gitAnnexTmpDir g </> "rsynctmp" </> show pid nuke tmp |