diff options
Diffstat (limited to 'Remote/Directory.hs')
-rw-r--r-- | Remote/Directory.hs | 23 |
1 files changed, 6 insertions, 17 deletions
diff --git a/Remote/Directory.hs b/Remote/Directory.hs index 18835c5de..664f8ca5f 100644 --- a/Remote/Directory.hs +++ b/Remote/Directory.hs @@ -9,25 +9,14 @@ module Remote.Directory (remote) where import qualified Data.ByteString.Lazy.Char8 as L import System.IO.Error -import Control.Exception.Extensible (IOException) import qualified Data.Map as M -import Control.Monad (when) -import Control.Monad.State (liftIO) -import System.Directory hiding (copyFile) -import System.FilePath -import Data.Maybe -import Types +import AnnexCommon +import Utility.CopyFile import Types.Remote import qualified Git -import qualified Annex import UUID -import Locations -import Utility.CopyFile import Config -import Utility -import Utility.Conditional -import Utility.Path import Utility.FileMode import Remote.Helper.Special import Remote.Helper.Encryptable @@ -82,14 +71,14 @@ dirKey d k = d </> hashDirMixed k </> f </> f store :: FilePath -> Key -> Annex Bool store d k = do - g <- Annex.gitRepo + g <- gitRepo let src = gitAnnexLocation g k let dest = dirKey d k - liftIO $ catchBool $ storeHelper dest $ copyFile src dest + liftIO $ catchBool $ storeHelper dest $ copyFileExternal src dest storeEncrypted :: FilePath -> (Cipher, Key) -> Key -> Annex Bool storeEncrypted d (cipher, enck) k = do - g <- Annex.gitRepo + g <- gitRepo let src = gitAnnexLocation g k let dest = dirKey d enck liftIO $ catchBool $ storeHelper dest $ encrypt src dest @@ -110,7 +99,7 @@ storeHelper dest a = do return ok retrieve :: FilePath -> Key -> FilePath -> Annex Bool -retrieve d k f = liftIO $ copyFile (dirKey d k) f +retrieve d k f = liftIO $ copyFileExternal (dirKey d k) f retrieveEncrypted :: FilePath -> (Cipher, Key) -> FilePath -> Annex Bool retrieveEncrypted d (cipher, enck) f = |