From bbfd91e7ea26cd07f9ab2c45903cb1cd538c2787 Mon Sep 17 00:00:00 2001 From: Simon Michael Date: Mon, 11 Mar 2013 15:56:56 +0000 Subject: [PATCH] directory 1.2 can be installed with older GHC, so we'd better pin it in the cabal file hledger now requires directory >= 1.2. This might make installation more complex on old GHC versions; if it turns out to be needed, perhaps it can be conditionalised again, more accurately, in the cabal file. --- hledger/Hledger/Cli/Utils.hs | 9 +-------- hledger/hledger.cabal | 4 ++-- 2 files changed, 3 insertions(+), 10 deletions(-) diff --git a/hledger/Hledger/Cli/Utils.hs b/hledger/Hledger/Cli/Utils.hs index 4598bc487..63d742a28 100644 --- a/hledger/Hledger/Cli/Utils.hs +++ b/hledger/Hledger/Cli/Utils.hs @@ -1,4 +1,4 @@ -{-# LANGUAGE ScopedTypeVariables, CPP #-} +{-# LANGUAGE ScopedTypeVariables #-} {-| Utilities for top-level modules and ghci. See also Hledger.Read and @@ -34,10 +34,8 @@ 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 @@ -103,14 +101,9 @@ fileModificationTime :: FilePath -> IO ClockTime fileModificationTime f | null f = getClockTime | otherwise = (do --- getModificationTime returned a ClockTime till GHC 7.6 (directory 1.2), now it's UTCTime -#if __GLASGOW_HASKELL__ < 706 - clo <- getModificationTime f -#else utc <- getModificationTime f let nom = utcTimeToPOSIXSeconds utc let clo = TOD (read $ takeWhile (`elem` "0123456789") $ show nom) 0 -- XXX read -#endif return clo ) `C.catch` \(_::C.IOException) -> getClockTime diff --git a/hledger/hledger.cabal b/hledger/hledger.cabal index e3c83c82e..4e56c7d50 100644 --- a/hledger/hledger.cabal +++ b/hledger/hledger.cabal @@ -67,7 +67,7 @@ library -- ,cabal-file-th ,containers ,cmdargs >= 0.10 && < 0.11 - ,directory + ,directory >= 1.2 ,filepath ,haskeline >= 0.6 && <= 0.8 ,HUnit @@ -120,7 +120,7 @@ executable hledger ,base >= 4.3 && < 5 ,containers ,cmdargs >= 0.10 && < 0.11 - ,directory + ,directory >= 1.2 ,filepath ,haskeline >= 0.6 && <= 0.8 ,HUnit