1
0
forked from GitHub/gf-core

ghc-7.6: allow directory-1.2

Get rid of old-time depend (and ClockTime in favour of UTCTime).
time-compat helps to retain backward compatibility with directory-1.1
and lower.
This commit is contained in:
Sergei Trofimovich
2013-03-09 21:38:43 +00:00
parent 6898804a11
commit 05e5895134
4 changed files with 17 additions and 14 deletions

View File

@@ -14,7 +14,8 @@ import System.Directory(doesDirectoryExist,doesFileExist,createDirectory,
setCurrentDirectory,getCurrentDirectory,
getDirectoryContents,removeFile,removeDirectory,
getModificationTime)
import System.Time(toUTCTime,formatCalendarTime)
import Data.Time.Compat (toUTCTime)
import Data.Time (formatTime)
import System.Locale(defaultTimeLocale,rfc822DateFormat)
import System.FilePath(dropExtension,takeExtension,takeFileName,takeDirectory,
(</>))
@@ -249,8 +250,7 @@ handle documentroot state0 cache execute1
do t <- liftIO $ getModificationTime path
return $ makeObj ["path".=path,"time".=format t]
where
format = formatCalendarTime defaultTimeLocale rfc822DateFormat
. toUTCTime
format = formatTime defaultTimeLocale rfc822DateFormat
rm path | takeExtension path `elem` ok_to_delete =
do b <- liftIO $ doesFileExist path