Work around a bug in rsync (IMHO) introduced by openSUSE's SIP patch.

openSUSE patches rsync with a patch adding SIP protocol support.
https://gist.github.com/2026167

With this patch, running rsync with no hostname parameter is apparently
supposed to list SIP hosts on the network. Practically, it does nothing
and exits 0.

git-annex uses rsync in a very special way to allow git-annex-shell to be
run on the remote host, and so did not need to specify a hostname, or a
file to transfer as a rsync parameter. So it sent ":", a degenerate case of
"host:file".

But the patch cannot differentiate ":" with no host parameter
(a bug in the SIP patch surely).

Results were that getting files failed, as rsync seemed to succeed, but the
requested file failed to arrive. Also I think that sending files will
make git-annex think a file has been transferred to the remote when
really rsync does nothing.

The workaround for this buggy rsync patch is to use "dummy:" as the
hostname.
This commit is contained in:
Joey Hess 2012-03-12 22:53:43 -04:00
parent 6a95240dff
commit b27760aa68
2 changed files with 6 additions and 2 deletions

View file

@ -290,10 +290,13 @@ rsyncParamsRemote r sending key file = do
then return $ o ++ eparam ++ [dummy, File file] then return $ o ++ eparam ++ [dummy, File file]
else return $ o ++ eparam ++ [File file, dummy] else return $ o ++ eparam ++ [File file, dummy]
where where
-- the rsync shell parameter controls where rsync -- The rsync shell parameter controls where rsync
-- goes, so the source/dest parameter can be a dummy value, -- goes, so the source/dest parameter can be a dummy value,
-- that just enables remote rsync mode. -- that just enables remote rsync mode.
dummy = Param ":" -- For maximum compatability with some patched rsyncs,
-- the dummy value needs to still contain a hostname,
-- even though this hostname will never be used.
dummy = Param "dummy:"
rsyncParams :: Git.Repo -> Annex [CommandParam] rsyncParams :: Git.Repo -> Annex [CommandParam]
rsyncParams r = do rsyncParams r = do

1
debian/changelog vendored
View file

@ -8,6 +8,7 @@ git-annex (3.20120310) UNRELEASED; urgency=low
are present in the annex in memory. are present in the annex in memory.
* status: Fixed to run in constant space. * status: Fixed to run in constant space.
* status: More accurate display of sizes of tmp and bad keys. * status: More accurate display of sizes of tmp and bad keys.
* Work around a bug in rsync (IMHO) introduced by openSUSE's SIP patch.
-- Joey Hess <joeyh@debian.org> Sat, 10 Mar 2012 14:03:22 -0400 -- Joey Hess <joeyh@debian.org> Sat, 10 Mar 2012 14:03:22 -0400