diff options
author | Joey Hess <joeyh@joeyh.name> | 2015-05-10 14:45:55 -0400 |
---|---|---|
committer | Joey Hess <joeyh@joeyh.name> | 2015-05-10 15:21:35 -0400 |
commit | ea506b28110d0e23210fb788b16ffe3deb92f23b (patch) | |
tree | e75cd9cbf7e45375f0619a97d2ffb62af3fe31ef /Command | |
parent | 0c7caf1e92eda1dde83b9fa95da5fc304ae2767d (diff) |
support time-1.5.0
This no longer uses old-locale's defaultTimeLocale, but provides one
of its own.
Factored out a Logs.TimeStamp.
Diffstat (limited to 'Command')
-rw-r--r-- | Command/Fsck.hs | 8 | ||||
-rw-r--r-- | Command/Log.hs | 6 |
2 files changed, 7 insertions, 7 deletions
diff --git a/Command/Fsck.hs b/Command/Fsck.hs index be59484d9..479f4521c 100644 --- a/Command/Fsck.hs +++ b/Command/Fsck.hs @@ -24,6 +24,7 @@ import Annex.Link import Logs.Location import Logs.Trust import Logs.Activity +import Logs.TimeStamp import Annex.NumCopies import Annex.UUID import Utility.DataUnits @@ -37,9 +38,7 @@ import Utility.PID import qualified Database.Fsck as FsckDb import Data.Time.Clock.POSIX -import Data.Time import System.Posix.Types (EpochTime) -import System.Locale cmd :: [Command] cmd = [withOptions fsckOptions $ command "fsck" paramPaths seek @@ -476,14 +475,11 @@ getStartTime u = do liftIO $ catchDefaultIO Nothing $ do timestamp <- modificationTime <$> getFileStatus f let fromstatus = Just (realToFrac timestamp) - fromfile <- readishTime <$> readFile f + fromfile <- parsePOSIXTime <$> readFile f return $ if matchingtimestamp fromfile fromstatus then Just timestamp else Nothing where - readishTime :: String -> Maybe POSIXTime - readishTime s = utcTimeToPOSIXSeconds <$> - parseTime defaultTimeLocale "%s%Qs" s matchingtimestamp fromfile fromstatus = #ifndef mingw32_HOST_OS fromfile == fromstatus diff --git a/Command/Log.hs b/Command/Log.hs index 4bc7bb89a..e1438ba15 100644 --- a/Command/Log.hs +++ b/Command/Log.hs @@ -5,15 +5,19 @@ - Licensed under the GNU GPL version 3 or higher. -} +{-# LANGUAGE CPP #-} + module Command.Log where import qualified Data.Set as S import qualified Data.Map as M import qualified Data.ByteString.Lazy.Char8 as L +import Data.Char import Data.Time.Clock.POSIX import Data.Time +#if ! MIN_VERSION_time(1,5,0) import System.Locale -import Data.Char +#endif import Common.Annex import Command |