on master help sign in
Remove obsolete isObsolete method
commit50418117e73d0a2b8c51ec35ed26994cef3df3b2 authorJasper Van der Jeugt <m@jaspervdj.be> dateMon 24 Sep 2012, 17:37 (14 years ago) parente848c4c
2 files changed+2−31
hakyll.cabal+1−1 src/Hakyll/Core/Util/File.hs+1−30
hakyll.cabal+1−1
@@ -1,5 +1,5 @@
11Name: hakyll
2−Version: 3.4.2.1
2+Version: 3.5.0.0
33
44Synopsis: A static website compiler library
55Description:
src/Hakyll/Core/Util/File.hs+1−30
@@ -3,16 +3,13 @@
33module Hakyll.Core.Util.File
44 ( makeDirectories
55 , getRecursiveContents
6− , isFileObsolete
76 , isFileInternal
87 ) where
98
109import Control.Applicative ((<$>))
11−import System.Time (ClockTime)
12−import Control.Monad (forM, filterM)
10+import Control.Monad (forM)
1311import Data.List (isPrefixOf)
1412import System.Directory ( createDirectoryIfMissing, doesDirectoryExist
15− , doesFileExist, getModificationTime
1613 , getDirectoryContents
1714 )
1815import System.FilePath ( normalise, takeDirectory, splitPath
@@ -49,32 +46,6 @@ getRecursiveContents includeDirs topdir = do
4946 where
5047 isProper = (`notElem` [".", ".."])
5148
52−-- | Check if a timestamp is obsolete compared to the timestamps of a number of
53−-- files. When they are no files, it is never obsolete.
54−--
55−isObsolete :: ClockTime -- ^ The time to check.
56− -> [FilePath] -- ^ Dependencies of the cached file.
57− -> IO Bool
58−isObsolete _ [] = return False
59−isObsolete timeStamp depends = do
60− depends' <- filterM doesFileExist depends
61− dependsModified <- mapM getModificationTime depends'
62− return (timeStamp < maximum dependsModified)
63−
64−-- | Check if a file is obsolete, given it's dependencies. When the file does
65−-- not exist, it is always obsolete. Other wise, it is obsolete if any of it's
66−-- dependencies has a more recent modification time than the file.
67−--
68−isFileObsolete :: FilePath -- ^ The cached file
69− -> [FilePath] -- ^ Dependencies of the cached file
70− -> IO Bool
71−isFileObsolete file depends = do
72− exists <- doesFileExist file
73− if not exists
74− then return True
75− else do timeStamp <- getModificationTime file
76− isObsolete timeStamp depends
77−
7849-- | Check if a file is meant for Hakyll internal use, i.e. if it is located in
7950-- the destination or store directory
8051--