diff options
author | Ben Gamari <bgamari.foss@gmail.com> | 2012-09-21 10:41:04 -0400 |
---|---|---|
committer | Ben Gamari <bgamari.foss@gmail.com> | 2012-09-21 15:43:26 -0400 |
commit | a96982e701e69730e6f5b1117b38f8ee4fef1276 (patch) | |
tree | ee493347508fb7a474be27b448a6fb6419137f24 | |
parent | bb4ea9d422fd2c17dc709cb4fcdfb93d42532eb5 (diff) | |
download | pandoc-a96982e701e69730e6f5b1117b38f8ee4fef1276.tar.gz |
Setup: getModificationTime returns UTCTime as of GHC 7.6
-rw-r--r-- | Setup.hs | 7 |
1 files changed, 7 insertions, 0 deletions
@@ -1,3 +1,5 @@ +{-# LANGUAGE CPP #-} + import Distribution.Simple import Distribution.Simple.Setup (copyDest, copyVerbosity, fromFlag, installVerbosity, BuildFlags(..)) @@ -20,6 +22,7 @@ import System.Time import System.IO.Error ( isDoesNotExistError ) import Data.Maybe ( catMaybes ) import Data.List ( (\\) ) +import Data.Time.Clock (UTCTime(..)) main :: IO () main = do @@ -82,7 +85,11 @@ modifiedDependencies :: FilePath -> [FilePath] -> IO [FilePath] modifiedDependencies file dependencies = do fileModTime <- catch (getModificationTime file) $ \e -> if isDoesNotExistError e +#if __GLASGOW_HASKELL__ >= 706 + then return (UTCTime (toEnum 0) 0) -- the minimum ClockTime +#else then return (TOD 0 0) -- the minimum ClockTime +#endif else ioError e depModTimes <- mapM getModificationTime dependencies let modified = zipWith (\dep time -> if time > fileModTime then Just dep else Nothing) dependencies depModTimes |