diff options
-rw-r--r-- | kiki.cabal | 11 | ||||
-rw-r--r-- | testkiki/testkiki.hs | 9 |
2 files changed, 16 insertions, 4 deletions
@@ -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 | ||
26 | Flag unixEnv | ||
27 | Default: False | ||
28 | |||
26 | Executable kiki | 29 | Executable 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) | ||
5 | import qualified System.Posix.Env | ||
6 | #endif | ||
3 | import System.Environment | 7 | import System.Environment |
4 | --import System.Posix.Env.ByteString (getEnv) | 8 | --import System.Posix.Env.ByteString (getEnv) |
5 | import System.Posix.Files | 9 | import System.Posix.Files |
@@ -15,6 +19,10 @@ import Control.Applicative | |||
15 | import Control.Monad | 19 | import Control.Monad |
16 | import qualified Data.ByteString.Char8 as B | 20 | import qualified Data.ByteString.Char8 as B |
17 | 21 | ||
22 | #if !MIN_VERSION_base(4,7,0) | ||
23 | setEnv k v = System.Posix.Env.setEnv k v True | ||
24 | unsetEnv = System.Posix.Env.unsetEnv | ||
25 | #endif | ||
18 | 26 | ||
19 | data TestKikiSettings = TKS | 27 | data 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 | |||
26 | main = do | 33 | main = do |
27 | args <- getArgs | 34 | args <- getArgs |
28 | cwd <- getCurrentDirectory | 35 | cwd <- getCurrentDirectory |