fix EvilLinker to not stomp on environment

This commit is contained in:
Joey Hess 2013-12-10 14:21:22 -04:00
parent 012b31548b
commit 6c1a50b4ea
2 changed files with 6 additions and 9 deletions

View file

@ -15,10 +15,12 @@ import Text.Parsec
import Text.Parsec.String import Text.Parsec.String
import Control.Applicative ((<$>)) import Control.Applicative ((<$>))
import Control.Monad import Control.Monad
import System.Directory
import Data.Maybe
import Utility.Monad import Utility.Monad
import Utility.Process import Utility.Process
import System.Directory import Utility.Env
data CmdParams = CmdParams data CmdParams = CmdParams
{ cmd :: String { cmd :: String
@ -121,7 +123,9 @@ restOfLine = newline `after` many (noneOf "\n")
getOutput :: String -> [String] -> Maybe [(String, String)] -> IO (String, Bool) getOutput :: String -> [String] -> Maybe [(String, String)] -> IO (String, Bool)
getOutput c ps environ = do getOutput c ps environ = do
putStrLn $ unwords [c, show ps] putStrLn $ unwords [c, show ps]
out@(s, ok) <- processTranscript' c ps environ Nothing systemenviron <- getEnvironment
let environ' = fromMaybe [] environ ++ systemenviron
out@(s, ok) <- processTranscript' c ps (Just environ') Nothing
putStrLn $ unwords [c, "finished", show ok, "output size:", show (length s)] putStrLn $ unwords [c, "finished", show ok, "output size:", show (length s)]
return out return out

View file

@ -51,13 +51,6 @@ withcyg cabal configure
if ! withcyg cabal build; then if ! withcyg cabal build; then
rm -f Build/EvilLinker.exe rm -f Build/EvilLinker.exe
ghc --make Build/EvilLinker ghc --make Build/EvilLinker
WINDIR='C:\Windows\Temp'
export WINDIR
mkdir tmp
TMP=tmp
TEMP=tmp
export TMP
export TEMP
Build/EvilLinker Build/EvilLinker
fi fi