From 161823d6eaff2adb7b99475b0edfe819fde11be1 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Thu, 18 Nov 2010 13:48:28 -0400 Subject: Only use cp -a if it is supported, falling back to cp -p or plain cp. * cp --reflink=auto is used if supported, and will make git annex unlock much faster on filesystems like btrfs that support copy of write. --- Remotes.hs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'Remotes.hs') diff --git a/Remotes.hs b/Remotes.hs index 7aad6c2a0..bf5ede572 100644 --- a/Remotes.hs +++ b/Remotes.hs @@ -23,7 +23,7 @@ import Control.Monad.State (liftIO) import Control.Monad (filterM) import qualified Data.Map as Map import Data.String.Utils -import System.Directory +import System.Directory hiding (copyFile) import System.Posix.Directory import List import Monad (when, unless) @@ -37,6 +37,7 @@ import UUID import Utility import qualified Core import Messages +import CopyFile {- Human visible list of remotes. -} list :: [Git.Repo] -> String @@ -204,7 +205,7 @@ copyFromRemote r key file = do then getssh else error "copying from non-ssh repo not supported" where - getlocal = liftIO $ boolSystem "cp" ["-a", keyloc, file] + getlocal = liftIO $ copyFile keyloc file getssh = scp r [sshLocation r keyloc, file] keyloc = annexLocation r key @@ -219,7 +220,7 @@ copyToRemote r key file = do then putssh keyloc else error "copying to non-ssh repo not supported" where - putlocal src = liftIO $ boolSystem "cp" ["-a", src, file] + putlocal src = liftIO $ copyFile src file putssh src = scp r [src, sshLocation r file] sshLocation :: Git.Repo -> FilePath -> FilePath -- cgit v1.2.3