diff options
author | Jasper Van der Jeugt <m@jaspervdj.be> | 2012-09-24 17:37:33 +0900 |
---|---|---|
committer | Jasper Van der Jeugt <m@jaspervdj.be> | 2012-09-24 17:37:33 +0900 |
commit | 50418117e73d0a2b8c51ec35ed26994cef3df3b2 (patch) | |
tree | 94052537097ca410de30e7823884d60bc2285557 /src/Hakyll | |
parent | e848c4cb16d0af7f3e710b0d25398d9793c774bb (diff) | |
download | hakyll-50418117e73d0a2b8c51ec35ed26994cef3df3b2.tar.gz |
Remove obsolete isObsolete method
Diffstat (limited to 'src/Hakyll')
-rw-r--r-- | src/Hakyll/Core/Util/File.hs | 31 |
1 files changed, 1 insertions, 30 deletions
diff --git a/src/Hakyll/Core/Util/File.hs b/src/Hakyll/Core/Util/File.hs index 24814ae..06a4f78 100644 --- a/src/Hakyll/Core/Util/File.hs +++ b/src/Hakyll/Core/Util/File.hs @@ -3,16 +3,13 @@ module Hakyll.Core.Util.File ( makeDirectories , getRecursiveContents - , isFileObsolete , isFileInternal ) where import Control.Applicative ((<$>)) -import System.Time (ClockTime) -import Control.Monad (forM, filterM) +import Control.Monad (forM) import Data.List (isPrefixOf) import System.Directory ( createDirectoryIfMissing, doesDirectoryExist - , doesFileExist, getModificationTime , getDirectoryContents ) import System.FilePath ( normalise, takeDirectory, splitPath @@ -49,32 +46,6 @@ getRecursiveContents includeDirs topdir = do where isProper = (`notElem` [".", ".."]) --- | Check if a timestamp is obsolete compared to the timestamps of a number of --- files. When they are no files, it is never obsolete. --- -isObsolete :: ClockTime -- ^ The time to check. - -> [FilePath] -- ^ Dependencies of the cached file. - -> IO Bool -isObsolete _ [] = return False -isObsolete timeStamp depends = do - depends' <- filterM doesFileExist depends - dependsModified <- mapM getModificationTime depends' - return (timeStamp < maximum dependsModified) - --- | Check if a file is obsolete, given it's dependencies. When the file does --- not exist, it is always obsolete. Other wise, it is obsolete if any of it's --- dependencies has a more recent modification time than the file. --- -isFileObsolete :: FilePath -- ^ The cached file - -> [FilePath] -- ^ Dependencies of the cached file - -> IO Bool -isFileObsolete file depends = do - exists <- doesFileExist file - if not exists - then return True - else do timeStamp <- getModificationTime file - isObsolete timeStamp depends - -- | Check if a file is meant for Hakyll internal use, i.e. if it is located in -- the destination or store directory -- |