git.iko.soy/typeable/pandoc
on master help sign in
Setup: getModificationTime returns UTCTime as of GHC 7.6
commita96982e701e69730e6f5b1117b38f8ee4fef1276 authorBen Gamari <bgamari.foss@gmail.com> dateFri 21 Sep 2012, 10:41 (14 years ago) parentbb4ea9d
1 file changed+7
Setup.hs+7
Setup.hs+7
@@ -1,3 +1,5 @@
1+{-# LANGUAGE CPP #-}
2+
13import Distribution.Simple
24import Distribution.Simple.Setup
35 (copyDest, copyVerbosity, fromFlag, installVerbosity, BuildFlags(..))
@@ -20,6 +22,7 @@ import System.Time
2022import System.IO.Error ( isDoesNotExistError )
2123import Data.Maybe ( catMaybes )
2224import Data.List ( (\\) )
25+import Data.Time.Clock (UTCTime(..))
2326
2427main :: IO ()
2528main = do
@@ -82,7 +85,11 @@ modifiedDependencies :: FilePath -> [FilePath] -> IO [FilePath]
8285modifiedDependencies file dependencies = do
8386 fileModTime <- catch (getModificationTime file) $
8487 \e -> if isDoesNotExistError e
88+#if __GLASGOW_HASKELL__ >= 706
89+ then return (UTCTime (toEnum 0) 0) -- the minimum ClockTime
90+#else
8591 then return (TOD 0 0) -- the minimum ClockTime
92+#endif
8693 else ioError e
8794 depModTimes <- mapM getModificationTime dependencies
8895 let modified = zipWith (\dep time -> if time > fileModTime then Just dep else Nothing) dependencies depModTimes