Revert "avoid rewriting SysConfig.hs with identical contents"
That made the Makefile want to rebuild the file each time if it's dependencies were newer, as it was not updated.
This commit is contained in:
parent
b9098a3e37
commit
0e6e840a2a
1 changed files with 1 additions and 8 deletions
|
@ -5,7 +5,6 @@ module Build.TestConfig where
|
||||||
import System.IO
|
import System.IO
|
||||||
import System.Cmd
|
import System.Cmd
|
||||||
import System.Exit
|
import System.Exit
|
||||||
import System.Directory
|
|
||||||
|
|
||||||
type ConfigKey = String
|
type ConfigKey = String
|
||||||
data ConfigValue =
|
data ConfigValue =
|
||||||
|
@ -37,14 +36,8 @@ instance Show Config where
|
||||||
valuetype (MaybeBoolConfig _) = "Maybe Bool"
|
valuetype (MaybeBoolConfig _) = "Maybe Bool"
|
||||||
|
|
||||||
writeSysConfig :: [Config] -> IO ()
|
writeSysConfig :: [Config] -> IO ()
|
||||||
writeSysConfig config = do
|
writeSysConfig config = writeFile "Build/SysConfig.hs" body
|
||||||
e <- doesFileExist dest
|
|
||||||
old <- if e then readFile dest else return []
|
|
||||||
if (old /= body)
|
|
||||||
then writeFile dest body
|
|
||||||
else return ()
|
|
||||||
where
|
where
|
||||||
dest = "Build/SysConfig.hs"
|
|
||||||
body = unlines $ header ++ map show config ++ footer
|
body = unlines $ header ++ map show config ++ footer
|
||||||
header = [
|
header = [
|
||||||
"{- Automatically generated. -}"
|
"{- Automatically generated. -}"
|
||||||
|
|
Loading…
Reference in a new issue