From 453cf431b296b87d8880a7ec26da82eb979d3405 Mon Sep 17 00:00:00 2001 From: Simon Michael Date: Fri, 8 Sep 2017 11:40:00 -0700 Subject: [PATCH] cli: drop support for directory < 1.2 --- hledger/Hledger/Cli/Utils.hs | 16 ---------------- 1 file changed, 16 deletions(-) diff --git a/hledger/Hledger/Cli/Utils.hs b/hledger/Hledger/Cli/Utils.hs index 5549424f7..ff9850c93 100644 --- a/hledger/Hledger/Cli/Utils.hs +++ b/hledger/Hledger/Cli/Utils.hs @@ -46,20 +46,8 @@ import Test.HUnit import Text.Printf import Text.Regex.TDFA ((=~)) --- kludge - adapt to whichever directory version is installed, or when --- cabal macros aren't available, assume the new directory -#ifdef MIN_VERSION_directory -#if MIN_VERSION_directory(1,2,0) -#define directory_1_2 -#endif -#else -#define directory_1_2 -#endif - -#ifdef directory_1_2 import System.Time (ClockTime(TOD)) import Data.Time.Clock.POSIX (utcTimeToPOSIXSeconds) -#endif import Hledger.Cli.CliOptions import Hledger.Data @@ -190,13 +178,9 @@ fileModificationTime :: FilePath -> IO ClockTime fileModificationTime f | null f = getClockTime | otherwise = (do -#ifdef directory_1_2 utc <- getModificationTime f let nom = utcTimeToPOSIXSeconds utc let clo = TOD (read $ takeWhile (`elem` "0123456789") $ show nom) 0 -- XXX read -#else - clo <- getModificationTime f -#endif return clo ) `C.catch` \(_::C.IOException) -> getClockTime