summaryrefslogtreecommitdiff
path: root/Remote/Helper/Ssh.hs
diff options
context:
space:
mode:
authorGravatar Joey Hess <joey@kitenet.net>2014-04-17 14:31:42 -0400
committerGravatar Joey Hess <joey@kitenet.net>2014-04-17 14:31:42 -0400
commit0edf9cafa3112fe4cf7b740b9b0f797b89acdbee (patch)
treeaf5d1a06ebbee54797c4bf115f8303acb5fa743e /Remote/Helper/Ssh.hs
parente7e07730cd988917a52693278b797a781feb0754 (diff)
Bring back rsync -p, but only when git-annex is running on a non-crippled file system. This is a better approach to fix #700282 while not unncessarily losing file permissions on non-crippled systems.
Diffstat (limited to 'Remote/Helper/Ssh.hs')
-rw-r--r--Remote/Helper/Ssh.hs19
1 files changed, 15 insertions, 4 deletions
diff --git a/Remote/Helper/Ssh.hs b/Remote/Helper/Ssh.hs
index 8de88953f..6848f7212 100644
--- a/Remote/Helper/Ssh.hs
+++ b/Remote/Helper/Ssh.hs
@@ -21,6 +21,7 @@ import Utility.Metered
import Utility.Rsync
import Types.Remote
import Logs.Transfer
+import Config
{- Generates parameters to ssh to a repository's host and run a command.
- Caller is responsible for doing any neccessary shellEscaping of the
@@ -122,7 +123,7 @@ rsyncParamsRemote direct r direction key file afile = do
fields
-- Convert the ssh command into rsync command line.
let eparam = rsyncShell (Param shellcmd:shellparams)
- let o = rsyncParams r direction
+ o <- rsyncParams r direction
return $ if direction == Download
then o ++ rsyncopts eparam dummy (File file)
else o ++ rsyncopts eparam (File file) dummy
@@ -140,9 +141,19 @@ rsyncParamsRemote direct r direction key file afile = do
dummy = Param "dummy:"
-- --inplace to resume partial files
-rsyncParams :: Remote -> Direction -> [CommandParam]
-rsyncParams r direction = Params "--progress --inplace" :
- map Param (remoteAnnexRsyncOptions gc ++ dps)
+--
+-- Only use --perms when not on a crippled file system, as rsync
+-- will fail trying to restore file perms onto a filesystem that does not
+-- support them.
+rsyncParams :: Remote -> Direction -> Annex [CommandParam]
+rsyncParams r direction = do
+ crippled <- crippledFileSystem
+ return $ map Param $ catMaybes
+ [ Just "--progress"
+ , Just "--inplace"
+ , if crippled then Nothing else Just "--perms"
+ ]
+ ++ remoteAnnexRsyncOptions gc ++ dps
where
dps
| direction == Download = remoteAnnexRsyncDownloadOptions gc