port transferkeys to windows; make stopping in progress transfers work too (probably)

transferkeys had used special FDs for communication, but that would be
quite annoying to do in Windows.

Instead, use stdin and stdout. But, to avoid commands like rsync stomping
on them and messing up the communications channel, they're duplicated to a
different handle; stdin is replaced with a null handle, and stdout is
replaced with a copy of stderr. This should all work in windows too.

Stopping in progress transfers may work on windows.. if the types unify
anyway. ;) May need some more porting.
This commit is contained in:
Joey Hess 2013-12-10 23:19:18 -04:00
parent 0fbbe79d8f
commit 2fd63f3cfa
6 changed files with 51 additions and 79 deletions

View file

@ -1,6 +1,6 @@
{- git-annex main program
-
- Copyright 2010 Joey Hess <joey@kitenet.net>
- Copyright 2010-2013 Joey Hess <joey@kitenet.net>
-
- Licensed under the GNU GPL version 3 or higher.
-}
@ -23,9 +23,7 @@ import qualified Command.Get
import qualified Command.FromKey
import qualified Command.DropKey
import qualified Command.TransferKey
#ifndef mingw32_HOST_OS
import qualified Command.TransferKeys
#endif
import qualified Command.ReKey
import qualified Command.Reinject
import qualified Command.Fix
@ -129,9 +127,7 @@ cmds = concat
, Command.FromKey.def
, Command.DropKey.def
, Command.TransferKey.def
#ifndef mingw32_HOST_OS
, Command.TransferKeys.def
#endif
, Command.ReKey.def
, Command.Fix.def
, Command.Fsck.def