diff --git a/hledger-lib/hledger-lib.cabal b/hledger-lib/hledger-lib.cabal index 48132c770..dc576e1e2 100644 --- a/hledger-lib/hledger-lib.cabal +++ b/hledger-lib/hledger-lib.cabal @@ -17,7 +17,7 @@ maintainer: Simon Michael homepage: http://hledger.org bug-reports: http://code.google.com/p/hledger/issues stability: beta -tested-with: GHC==7.0.4, GHC==7.2.2, GHC==7.4.1 +tested-with: GHC==7.0.4, GHC==7.2.2, GHC==7.4.1, GHC==7.6.1 cabal-version: >= 1.8 build-type: Simple -- data-dir: data diff --git a/hledger/Hledger/Cli/Utils.hs b/hledger/Hledger/Cli/Utils.hs index cdfd0a38f..e5899091c 100644 --- a/hledger/Hledger/Cli/Utils.hs +++ b/hledger/Hledger/Cli/Utils.hs @@ -1,4 +1,4 @@ -{-# LANGUAGE ScopedTypeVariables #-} +{-# LANGUAGE ScopedTypeVariables, CPP #-} {-| Utilities for top-level modules and ghci. See also Hledger.Read and @@ -34,6 +34,10 @@ import System.Process (readProcessWithExitCode) import System.Time (ClockTime, getClockTime, diffClockTimes, TimeDiff(TimeDiff)) import Test.HUnit import Text.Printf +#if __GLASGOW_HASKELL__ >= 706 +import System.Time (ClockTime(TOD)) +import Data.Time.Clock.POSIX (utcTimeToPOSIXSeconds) +#endif import Hledger.Cli.Options import Hledger.Data @@ -98,8 +102,17 @@ journalSpecifiedFileIsNewer Journal{filereadtime=tread} f = do fileModificationTime :: FilePath -> IO ClockTime fileModificationTime f | null f = getClockTime - | otherwise = getModificationTime f `C.catch` \(_::C.IOException) -> getClockTime - + | otherwise = (do +#if __GLASGOW_HASKELL__ < 706 + clo <- getModificationTime f +#else + utc <- getModificationTime f + let nom = utcTimeToPOSIXSeconds utc + let clo = TOD (read $ show nom) 0 -- XXX +#endif + return clo + ) + `C.catch` \(_::C.IOException) -> getClockTime -- | Attempt to open a web browser on the given url, all platforms. openBrowserOn :: String -> IO ExitCode openBrowserOn u = trybrowsers browsers u diff --git a/hledger/hledger.cabal b/hledger/hledger.cabal index 4c478402d..d1a804987 100644 --- a/hledger/hledger.cabal +++ b/hledger/hledger.cabal @@ -18,7 +18,7 @@ maintainer: Simon Michael homepage: http://hledger.org bug-reports: http://code.google.com/p/hledger/issues stability: beta -tested-with: GHC==7.0.4, GHC==7.2.2, GHC==7.4.1 +tested-with: GHC==7.0.4, GHC==7.2.2, GHC==7.4.1, GHC==7.6.1 cabal-version: >= 1.8 build-type: Simple -- data-dir: data