diff options
author | Joey Hess <joeyh@joeyh.name> | 2017-11-14 14:25:46 -0400 |
---|---|---|
committer | Joey Hess <joeyh@joeyh.name> | 2017-11-14 14:28:49 -0400 |
commit | ad1e45aaedee71fbae100d2d73ff56b6d09e1577 (patch) | |
tree | 26f816e04a90e10aef3e7467695f6a04d06894d0 /Test.hs | |
parent | db5dd896f37700a9acc59dae76da45d60ec59821 (diff) |
split out setEnv to avoid adding dep
Windows needs the setenv package in custom-setup, but I don't want to
pull it in on unix, which would probably break some builds and need more
work. Instead, split out setEnv to a separate module.
Quite likely, unix-compat will get a portable environment layer, and
then both modules can be removed from here.
This commit was sponsored by Øyvind Andersen Holm.
Diffstat (limited to 'Test.hs')
-rw-r--r-- | Test.hs | 11 |
1 files changed, 6 insertions, 5 deletions
@@ -95,6 +95,7 @@ import qualified Utility.Process import qualified Utility.Misc import qualified Utility.InodeCache import qualified Utility.Env +import qualified Utility.Env.Set import qualified Utility.Matcher import qualified Utility.Exception import qualified Utility.Hash @@ -142,7 +143,7 @@ runner = Just go subenv = "GIT_ANNEX_TEST_SUBPROCESS" runsubprocesstests opts Nothing = do pp <- Annex.Path.programPath - Utility.Env.setEnv subenv "1" True + Utility.Env.Set.setEnv subenv "1" True ps <- getArgs (Nothing, Nothing, Nothing, pid) <-createProcess (proc pp ps) exitcode <- waitForProcess pid @@ -1931,9 +1932,9 @@ ensuretmpdir = do isolateGitConfig :: IO a -> IO a isolateGitConfig a = Utility.Tmp.withTmpDir "testhome" $ \tmphome -> do tmphomeabs <- absPath tmphome - Utility.Env.setEnv "HOME" tmphomeabs True - Utility.Env.setEnv "XDG_CONFIG_HOME" tmphomeabs True - Utility.Env.setEnv "GIT_CONFIG_NOSYSTEM" "1" True + Utility.Env.Set.setEnv "HOME" tmphomeabs True + Utility.Env.Set.setEnv "XDG_CONFIG_HOME" tmphomeabs True + Utility.Env.Set.setEnv "GIT_CONFIG_NOSYSTEM" "1" True a cleanup :: FilePath -> IO () @@ -2119,7 +2120,7 @@ setTestMode testmode = do currdir <- getCurrentDirectory p <- Utility.Env.getEnvDefault "PATH" "" - mapM_ (\(var, val) -> Utility.Env.setEnv var val True) + mapM_ (\(var, val) -> Utility.Env.Set.setEnv var val True) -- Ensure that the just-built git annex is used. [ ("PATH", currdir ++ [searchPathSeparator] ++ p) , ("TOPDIR", currdir) |