From 50418117e73d0a2b8c51ec35ed26994cef3df3b2 Mon Sep 17 00:00:00 2001 From: Jasper Van der Jeugt Date: Mon, 24 Sep 2012 17:37:33 +0900 Subject: Remove obsolete isObsolete method --- src/Hakyll/Core/Util/File.hs | 31 +------------------------------ 1 file changed, 1 insertion(+), 30 deletions(-) (limited to 'src/Hakyll/Core/Util') 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 -- -- cgit v1.2.3