summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Remote/Git.hs4
-rw-r--r--Remote/Helper/Ssh.hs19
-rw-r--r--debian/changelog3
-rw-r--r--doc/bugs/git-annex_clears_files__39___og+r_permissions_when_rsync_transfer_is_interrupted_and_resumed.mdwn2
4 files changed, 22 insertions, 6 deletions
diff --git a/Remote/Git.hs b/Remote/Git.hs
index 209312d67..83964e180 100644
--- a/Remote/Git.hs
+++ b/Remote/Git.hs
@@ -312,7 +312,7 @@ copyFromRemote r key file dest _p = copyFromRemote' r key file dest
copyFromRemote' :: Remote -> Key -> AssociatedFile -> FilePath -> Annex Bool
copyFromRemote' r key file dest
| not $ Git.repoIsUrl (repo r) = guardUsable (repo r) False $ do
- let params = Ssh.rsyncParams r Download
+ params <- Ssh.rsyncParams r Download
u <- getUUID
-- run copy from perspective of remote
onLocal r $ do
@@ -411,7 +411,7 @@ copyToRemote r key file p
-- the remote's Annex, but it needs access to the current
-- Annex monad's state.
checksuccessio <- Annex.withCurrentState checksuccess
- let params = Ssh.rsyncParams r Upload
+ params <- Ssh.rsyncParams r Upload
u <- getUUID
-- run copy from perspective of remote
onLocal r $ ifM (Annex.Content.inAnnex key)
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
diff --git a/debian/changelog b/debian/changelog
index 817e4d4b6..7c6d0bc5b 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -23,6 +23,9 @@ git-annex (5.20140413) UNRELEASED; urgency=medium
to clone it back the way it was.
* drop --from: When local repository is untrusted, its copy of a file does
not count.
+ * 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.
-- Joey Hess <joeyh@debian.org> Fri, 11 Apr 2014 21:33:35 -0400
diff --git a/doc/bugs/git-annex_clears_files__39___og+r_permissions_when_rsync_transfer_is_interrupted_and_resumed.mdwn b/doc/bugs/git-annex_clears_files__39___og+r_permissions_when_rsync_transfer_is_interrupted_and_resumed.mdwn
index 2dfd69440..2e86f488d 100644
--- a/doc/bugs/git-annex_clears_files__39___og+r_permissions_when_rsync_transfer_is_interrupted_and_resumed.mdwn
+++ b/doc/bugs/git-annex_clears_files__39___og+r_permissions_when_rsync_transfer_is_interrupted_and_resumed.mdwn
@@ -43,3 +43,5 @@ Linux
# End of transcript or log.
"""]]
+
+> [[fixed|done]]; brought back -p on non-crippled file systems --[[Joey]]