aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Joey Hess <joeyh@joeyh.name>2015-10-04 15:46:25 -0400
committerGravatar Joey Hess <joeyh@joeyh.name>2015-10-04 15:46:25 -0400
commitb411eb441024d5f4afa360ea3ff53c9a502a86a0 (patch)
tree07a598642db1deff9779d80f05b6951205ce1a2a
parent11d7cdc840c5e30310198eb3a5c3ff39a30e2907 (diff)
parentda451ad509268133fff9b2f58caebae2204b318e (diff)
Merge branch 'winprocfix'
-rw-r--r--Build/EvilLinker.hs3
-rw-r--r--Utility/Process.hs12
-rw-r--r--debian/changelog2
-rw-r--r--doc/bugs/windows_ssh_webapp_password_entry_broken.mdwn2
-rw-r--r--git-annex.cabal3
5 files changed, 13 insertions, 9 deletions
diff --git a/Build/EvilLinker.hs b/Build/EvilLinker.hs
index fa260edab..97f218fd5 100644
--- a/Build/EvilLinker.hs
+++ b/Build/EvilLinker.hs
@@ -21,6 +21,7 @@ import Data.List
import Utility.Monad
import Utility.Process hiding (env)
+import qualified Utility.Process
import Utility.Env
data CmdParams = CmdParams
@@ -126,7 +127,7 @@ getOutput c ps environ = do
putStrLn $ unwords [c, show ps]
systemenviron <- getEnvironment
let environ' = fromMaybe [] environ ++ systemenviron
- out@(_, ok) <- processTranscript' c ps (Just environ') Nothing
+ out@(_, ok) <- processTranscript' (\p -> p { Utility.Process.env = Just environ' }) c ps Nothing
putStrLn $ unwords [c, "finished", show ok]
return out
diff --git a/Utility/Process.hs b/Utility/Process.hs
index c4882a014..cc1138678 100644
--- a/Utility/Process.hs
+++ b/Utility/Process.hs
@@ -172,22 +172,21 @@ createBackgroundProcess p a = a =<< createProcess p
-- returns a transcript combining its stdout and stderr, and
-- whether it succeeded or failed.
processTranscript :: String -> [String] -> (Maybe String) -> IO (String, Bool)
-processTranscript cmd opts = processTranscript' cmd opts Nothing
+processTranscript = processTranscript' id
-processTranscript' :: String -> [String] -> Maybe [(String, String)] -> (Maybe String) -> IO (String, Bool)
-processTranscript' cmd opts environ input = do
+processTranscript' :: (CreateProcess -> CreateProcess) -> String -> [String] -> Maybe String -> IO (String, Bool)
+processTranscript' modproc cmd opts input = do
#ifndef mingw32_HOST_OS
{- This implementation interleves stdout and stderr in exactly the order
- the process writes them. -}
(readf, writef) <- System.Posix.IO.createPipe
readh <- System.Posix.IO.fdToHandle readf
writeh <- System.Posix.IO.fdToHandle writef
- p@(_, _, _, pid) <- createProcess $
+ p@(_, _, _, pid) <- createProcess $ modproc $
(proc cmd opts)
{ std_in = if isJust input then CreatePipe else Inherit
, std_out = UseHandle writeh
, std_err = UseHandle writeh
- , env = environ
}
hClose writeh
@@ -199,12 +198,11 @@ processTranscript' cmd opts environ input = do
return (transcript, ok)
#else
{- This implementation for Windows puts stderr after stdout. -}
- p@(_, _, _, pid) <- createProcess $
+ p@(_, _, _, pid) <- createProcess $ modproc $
(proc cmd opts)
{ std_in = if isJust input then CreatePipe else Inherit
, std_out = CreatePipe
, std_err = CreatePipe
- , env = environ
}
getout <- mkreader (stdoutHandle p)
diff --git a/debian/changelog b/debian/changelog
index 57db377df..1c1aa63c7 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -11,6 +11,8 @@ git-annex (5.20150931) UNRELEASED; urgency=medium
setting annex.verify=false.
* Allow building with S3 disabled again.
* Ported disk free space checking code to work on Solaris.
+ * Windows webapp: Fix support for entering password when setting
+ up a ssh remote.
-- Joey Hess <id@joeyh.name> Thu, 01 Oct 2015 12:42:56 -0400
diff --git a/doc/bugs/windows_ssh_webapp_password_entry_broken.mdwn b/doc/bugs/windows_ssh_webapp_password_entry_broken.mdwn
index 0c4d2d38a..1b6f41e2c 100644
--- a/doc/bugs/windows_ssh_webapp_password_entry_broken.mdwn
+++ b/doc/bugs/windows_ssh_webapp_password_entry_broken.mdwn
@@ -7,3 +7,5 @@ set up a passwordless ssh key that can log into the ssh server. --[[Joey]]
> I have a `winprocfix` branch that uses process-1.3 which has been
> enhanced to allow fixing this. Merging is currently blocked on
> <https://github.com/pcapriotti/optparse-applicative/issues/153> --[[Joey]]
+>
+> [[fixed|done]] --[[Joey]]
diff --git a/git-annex.cabal b/git-annex.cabal
index 0b517b639..acf7e63e9 100644
--- a/git-annex.cabal
+++ b/git-annex.cabal
@@ -157,7 +157,8 @@ Executable git-annex
GHC-Options: -O2
if (os(windows))
- Build-Depends: Win32, Win32-extras, unix-compat (>= 0.4.1.3), setenv
+ Build-Depends: Win32, Win32-extras, unix-compat (>= 0.4.1.3), setenv,
+ process (>= 1.3.0.0)
else
Build-Depends: unix
-- Need to list these because they're generated from .hsc files.