From 899f84a217681833146fadd8f30cd25ed1a9f653 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Tue, 10 Jun 2014 19:20:14 -0400 Subject: export CreateProcess fields from Utility.Process update code to avoid cwd and env redefinition warnings --- Assistant/Install.hs | 10 +++++----- Assistant/Threads/RemoteControl.hs | 1 - Assistant/TransferrerPool.hs | 1 - Assistant/XMPP/Git.hs | 9 ++++----- 4 files changed, 9 insertions(+), 12 deletions(-) (limited to 'Assistant') diff --git a/Assistant/Install.hs b/Assistant/Install.hs index afbe5b9c0..89025cdae 100644 --- a/Assistant/Install.hs +++ b/Assistant/Install.hs @@ -122,15 +122,15 @@ installNautilus _ = noop cleanEnvironment :: IO (Maybe [(String, String)]) cleanEnvironment = clean <$> getEnvironment where - clean env + clean environ | null vars = Nothing - | otherwise = Just $ catMaybes $ map (restoreorig env) env + | otherwise = Just $ catMaybes $ map (restoreorig environ) environ | otherwise = Nothing where vars = words $ fromMaybe "" $ - lookup "GIT_ANNEX_STANDLONE_ENV" env - restoreorig oldenv p@(k, _v) - | k `elem` vars = case lookup ("ORIG_" ++ k) oldenv of + lookup "GIT_ANNEX_STANDLONE_ENV" environ + restoreorig oldenviron p@(k, _v) + | k `elem` vars = case lookup ("ORIG_" ++ k) oldenviron of (Just v') | not (null v') -> Just (k, v') _ -> Nothing diff --git a/Assistant/Threads/RemoteControl.hs b/Assistant/Threads/RemoteControl.hs index 317efe412..5af4fddcd 100644 --- a/Assistant/Threads/RemoteControl.hs +++ b/Assistant/Threads/RemoteControl.hs @@ -22,7 +22,6 @@ import qualified Types.Remote as Remote import Control.Concurrent import Control.Concurrent.Async -import System.Process (std_in, std_out) import Network.URI import qualified Data.Map as M import qualified Data.Set as S diff --git a/Assistant/TransferrerPool.hs b/Assistant/TransferrerPool.hs index cfd6e01fa..3ac9f3452 100644 --- a/Assistant/TransferrerPool.hs +++ b/Assistant/TransferrerPool.hs @@ -15,7 +15,6 @@ import Utility.Batch import qualified Command.TransferKeys as T import Control.Concurrent.STM hiding (check) -import System.Process (create_group, std_in, std_out) import Control.Exception (throw) import Control.Concurrent diff --git a/Assistant/XMPP/Git.hs b/Assistant/XMPP/Git.hs index 36ada5c08..301aa7185 100644 --- a/Assistant/XMPP/Git.hs +++ b/Assistant/XMPP/Git.hs @@ -38,7 +38,6 @@ import Utility.Env import Network.Protocol.XMPP import qualified Data.Text as T import System.Posix.Types -import System.Process (std_in, std_out, std_err) import Control.Concurrent import System.Timeout import qualified Data.ByteString as B @@ -112,15 +111,15 @@ xmppPush cid gitpush = do tmpdir <- gettmpdir installwrapper tmpdir - env <- liftIO getEnvironment + environ <- liftIO getEnvironment path <- liftIO getSearchPath - let myenv = addEntries + let myenviron = addEntries [ ("PATH", intercalate [searchPathSeparator] $ tmpdir:path) , (relayIn, show inf) , (relayOut, show outf) , (relayControl, show controlf) ] - env + environ inh <- liftIO $ fdToHandle readpush outh <- liftIO $ fdToHandle writepush @@ -132,7 +131,7 @@ xmppPush cid gitpush = do {- This can take a long time to run, so avoid running it in the - Annex monad. Also, override environment. -} g <- liftAnnex gitRepo - r <- liftIO $ gitpush $ g { gitEnv = Just myenv } + r <- liftIO $ gitpush $ g { gitEnv = Just myenviron } liftIO $ do mapM_ killThread [t1, t2] -- cgit v1.2.3