summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--kiki.cabal11
-rw-r--r--testkiki/testkiki.hs9
2 files changed, 16 insertions, 4 deletions
diff --git a/kiki.cabal b/kiki.cabal
index c73eb67..3810355 100644
--- a/kiki.cabal
+++ b/kiki.cabal
@@ -23,6 +23,9 @@ Flag needlocale
23 Description: Link against old-locale package for older versions of the time package. 23 Description: Link against old-locale package for older versions of the time package.
24 Default: False 24 Default: False
25 25
26Flag unixEnv
27 Default: False
28
26Executable kiki 29Executable kiki
27 Main-is: kiki.hs 30 Main-is: kiki.hs
28 -- base >=4.6 due to use of readEither in KikiD.Message 31 -- base >=4.6 due to use of readEither in KikiD.Message
@@ -126,8 +129,7 @@ Test-suite testkiki
126 type: exitcode-stdio-1.0 129 type: exitcode-stdio-1.0
127 Main-is: testkiki.hs 130 Main-is: testkiki.hs
128 hs-source-dirs: testkiki 131 hs-source-dirs: testkiki
129 Build-depends: base 132 Build-depends: Cabal
130 , Cabal
131 , hspec 133 , hspec
132 , process 134 , process
133 , directory 135 , directory
@@ -135,4 +137,7 @@ Test-suite testkiki
135 , filepath 137 , filepath
136 , bytestring 138 , bytestring
137 , kiki 139 , kiki
138 140 if flag(unixEnv)
141 Build-depends: base < 4.7.0, unix
142 else
143 Build-depends: base >= 4.7.0
diff --git a/testkiki/testkiki.hs b/testkiki/testkiki.hs
index 839cebf..32c8284 100644
--- a/testkiki/testkiki.hs
+++ b/testkiki/testkiki.hs
@@ -1,5 +1,9 @@
1{-# LANGUAGE OverloadedStrings #-} 1{-# LANGUAGE OverloadedStrings #-}
2{-# LANGUAGE DoAndIfThenElse #-} 2{-# LANGUAGE DoAndIfThenElse #-}
3{-# LANGUAGE CPP #-}
4#if !MIN_VERSION_base(4,7,0)
5import qualified System.Posix.Env
6#endif
3import System.Environment 7import System.Environment
4--import System.Posix.Env.ByteString (getEnv) 8--import System.Posix.Env.ByteString (getEnv)
5import System.Posix.Files 9import System.Posix.Files
@@ -15,6 +19,10 @@ import Control.Applicative
15import Control.Monad 19import Control.Monad
16import qualified Data.ByteString.Char8 as B 20import qualified Data.ByteString.Char8 as B
17 21
22#if !MIN_VERSION_base(4,7,0)
23setEnv k v = System.Posix.Env.setEnv k v True
24unsetEnv = System.Posix.Env.unsetEnv
25#endif
18 26
19data TestKikiSettings = TKS 27data TestKikiSettings = TKS
20 { gnupghome :: FilePath 28 { gnupghome :: FilePath
@@ -22,7 +30,6 @@ data TestKikiSettings = TKS
22 } 30 }
23 deriving (Show,Eq) 31 deriving (Show,Eq)
24 32
25
26main = do 33main = do
27 args <- getArgs 34 args <- getArgs
28 cwd <- getCurrentDirectory 35 cwd <- getCurrentDirectory