summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Joey Hess <joey@kitenet.net>2010-11-18 14:07:22 -0400
committerGravatar Joey Hess <joey@kitenet.net>2010-11-18 14:07:22 -0400
commit09964033777ea206db0ff0a27f7928184c70c879 (patch)
tree0e24f4206e28552546e8fa49344d9e3348d24f44
parent161823d6eaff2adb7b99475b0edfe819fde11be1 (diff)
tweak
-rw-r--r--configure.hs15
1 files changed, 7 insertions, 8 deletions
diff --git a/configure.hs b/configure.hs
index 56daf583a..d9ce60a14 100644
--- a/configure.hs
+++ b/configure.hs
@@ -9,6 +9,12 @@ type Test = IO Bool
data TestDesc = TestDesc String String Test
data Config = Config String Bool
+instance Show Config where
+ show (Config key value) = unlines $ [
+ key ++ " :: Bool"
+ , key ++ " = " ++ show value
+ ]
+
tests :: [TestDesc]
tests = [
TestDesc "cp -a" "cp_a" $ testCp "-a"
@@ -44,7 +50,7 @@ testEnd r = putStrLn $ " " ++ (show r)
writeSysConfig :: [Config] -> IO ()
writeSysConfig config = do
- writeFile "SysConfig.hs" $ unlines $ header ++ vars config ++ footer
+ writeFile "SysConfig.hs" $ unlines $ header ++ map show config ++ footer
where
header = [
"{- Automatically generated by configure. -}"
@@ -52,13 +58,6 @@ writeSysConfig config = do
, ""
]
footer = []
- vars [] = []
- vars (c:cs) = showvar c ++ vars cs
- showvar (Config name val) = [
- name ++ " :: Bool"
- , name ++ " = " ++ show val
- , ""
- ]
runTests :: [TestDesc] -> IO [Config]
runTests [] = return []