summaryrefslogtreecommitdiff
path: root/Remote
diff options
context:
space:
mode:
authorGravatar Joey Hess <joey@kitenet.net>2014-06-10 19:20:14 -0400
committerGravatar Joey Hess <joey@kitenet.net>2014-06-10 19:20:14 -0400
commit899f84a217681833146fadd8f30cd25ed1a9f653 (patch)
tree37351958f69f8afef17b96966a30ca2dde79ba1c /Remote
parent465c36e8f6a45b888e8f7be8baa52f0eb1759f77 (diff)
export CreateProcess fields from Utility.Process
update code to avoid cwd and env redefinition warnings
Diffstat (limited to 'Remote')
-rw-r--r--Remote/External.hs1
-rw-r--r--Remote/Git.hs9
-rw-r--r--Remote/Glacier.hs2
-rw-r--r--Remote/Hook.hs16
4 files changed, 12 insertions, 16 deletions
diff --git a/Remote/External.hs b/Remote/External.hs
index 9be9175c7..464e9b57e 100644
--- a/Remote/External.hs
+++ b/Remote/External.hs
@@ -28,7 +28,6 @@ import Annex.Exception
import Creds
import Control.Concurrent.STM
-import System.Process (std_in, std_out, std_err)
import System.Log.Logger (debugM)
import qualified Data.Map as M
import qualified Data.ByteString.Lazy as L
diff --git a/Remote/Git.hs b/Remote/Git.hs
index da702730a..5dcd3bf15 100644
--- a/Remote/Git.hs
+++ b/Remote/Git.hs
@@ -55,7 +55,6 @@ import Creds
import Control.Concurrent
import Control.Concurrent.MSampleVar
-import System.Process (std_in, std_err)
import qualified Data.Map as M
import Control.Exception.Extensible
@@ -467,12 +466,12 @@ fsckOnRemote r params
| otherwise = return $ do
program <- readProgramFile
r' <- Git.Config.read r
- env <- getEnvironment
- let env' = addEntries
+ environ <- getEnvironment
+ let environ' = addEntries
[ ("GIT_WORK_TREE", Git.repoPath r')
, ("GIT_DIR", Git.localGitDir r')
- ] env
- batchCommandEnv program (Param "fsck" : params) $ Just env'
+ ] environ
+ batchCommandEnv program (Param "fsck" : params) $ Just environ'
{- The passed repair action is run in the Annex monad of the remote. -}
repairRemote :: Git.Repo -> Annex Bool -> Annex (IO Bool)
diff --git a/Remote/Glacier.hs b/Remote/Glacier.hs
index eb274714b..00be9e1a9 100644
--- a/Remote/Glacier.hs
+++ b/Remote/Glacier.hs
@@ -27,8 +27,6 @@ import Annex.Content
import Annex.UUID
import Utility.Env
-import System.Process
-
type Vault = String
type Archive = FilePath
diff --git a/Remote/Hook.hs b/Remote/Hook.hs
index 3735c228c..74641f5aa 100644
--- a/Remote/Hook.hs
+++ b/Remote/Hook.hs
@@ -79,15 +79,15 @@ hookEnv :: Action -> Key -> Maybe FilePath -> IO (Maybe [(String, String)])
hookEnv action k f = Just <$> mergeenv (fileenv f ++ keyenv)
where
mergeenv l = addEntries l <$> getEnvironment
- env s v = ("ANNEX_" ++ s, v)
+ envvar s v = ("ANNEX_" ++ s, v)
keyenv = catMaybes
- [ Just $ env "KEY" (key2file k)
- , Just $ env "ACTION" action
- , env "HASH_1" <$> headMaybe hashbits
- , env "HASH_2" <$> headMaybe (drop 1 hashbits)
+ [ Just $ envvar "KEY" (key2file k)
+ , Just $ envvar "ACTION" action
+ , envvar "HASH_1" <$> headMaybe hashbits
+ , envvar "HASH_2" <$> headMaybe (drop 1 hashbits)
]
fileenv Nothing = []
- fileenv (Just file) = [env "FILE" file]
+ fileenv (Just file) = [envvar "FILE" file]
hashbits = map takeDirectory $ splitPath $ hashDirMixed k
lookupHook :: HookName -> Action -> Annex (Maybe String)
@@ -155,5 +155,5 @@ checkPresent r h k = do
findkey s = key2file k `elem` lines s
check Nothing = error $ action ++ " hook misconfigured"
check (Just hook) = do
- env <- hookEnv action k Nothing
- findkey <$> readProcessEnv "sh" ["-c", hook] env
+ environ <- hookEnv action k Nothing
+ findkey <$> readProcessEnv "sh" ["-c", hook] environ