Rsync will now be used to resume interrupted/failed partial file transfers from a remote.

This commit is contained in:
Joey Hess 2010-12-02 16:55:21 -04:00
parent ade43d8fab
commit 37941184f9
6 changed files with 35 additions and 10 deletions

View file

@ -20,8 +20,9 @@ tests = [
TestCase "cp -a" "cp_a" $ testCp "-a"
, TestCase "cp -p" "cp_p" $ testCp "-p"
, TestCase "cp --reflink=auto" "cp_reflink_auto" $ testCp "--reflink=auto"
, TestCase "uuid" "uuid" $ requireCommand "uuid" "uuid"
, TestCase "xargs -0" "xargs_0" $ requireCommand "xargs -0" "xargs -0 </dev/null"
, TestCase "uuid" "uuid" $ requireCmd "uuid" "uuid"
, TestCase "xargs -0" "xargs_0" $ requireCmd "xargs -0" "xargs -0 </dev/null"
, TestCase "rsync" "rsync" $ testCmd "rsync --version >/dev/null"
]
tmpDir :: String
@ -33,14 +34,14 @@ testFile = tmpDir ++ "/testfile"
quiet :: String -> String
quiet s = s ++ " >/dev/null 2>&1"
requireCommand :: String -> String -> Test
requireCommand command cmdline = do
requireCmd :: String -> String -> Test
requireCmd c cmdline = do
ret <- testCmd $ quiet cmdline
if ret
then return True
else do
testEnd False
error $ "** the " ++ command ++ " command is required to use git-annex"
error $ "** the " ++ c ++ " command is required to use git-annex"
testCp :: String -> Test
testCp option = testCmd $ quiet $ "cp " ++ option ++ " " ++ testFile ++