gitit 0.10.1 → 0.10.1.1
raw patch · 4 files changed
+22/−6 lines, 4 filesdep ~directoryPVP ok
version bump matches the API change (PVP)
Dependency ranges changed: directory
API changes (from Hackage documentation)
Files
- CHANGES +4/−0
- Network/Gitit/Cache.hs +11/−0
- Network/Gitit/Handlers.hs +5/−4
- gitit.cabal +2/−2
CHANGES view
@@ -1,3 +1,7 @@+Version 0.10.1.1 released 01 Jan 2013++* Allow compilation with directory < 1.2.+ Version 0.10.1 released 31 Dec 2012 * Fixed duplicate dropExtension on categoryPage. (atsuo yamada)
Network/Gitit/Cache.hs view
@@ -1,3 +1,4 @@+{-# LANGUAGE CPP #-} {- Copyright (C) 2008 John MacFarlane <jgm@berkeley.edu> @@ -28,6 +29,11 @@ import System.FilePath import System.Directory (doesFileExist, removeFile, createDirectoryIfMissing, getModificationTime) import Data.Time.Clock (UTCTime)+#if MIN_VERSION_directory(1,2,0)+#else+import System.Time (ClockTime(..))+import Data.Time.Clock.POSIX (posixSecondsToUTCTime)+#endif import Network.Gitit.State import Network.Gitit.Types import Control.Monad@@ -60,7 +66,12 @@ exists <- liftIO $ doesFileExist target if exists then liftIO $ do+#if MIN_VERSION_directory(1,2,0) modtime <- getModificationTime target+#else+ TOD secs _ <- getModificationTime target+ let modtime = posixSecondsToUTCTime $ fromIntegral secs+#endif contents <- B.readFile target return $ Just (modtime, contents) else return Nothing
Network/Gitit/Handlers.hs view
@@ -77,7 +77,8 @@ import qualified Data.ByteString.Lazy as B import qualified Data.ByteString as S import Network.HTTP (urlEncodeVars)-import Data.Time.Clock+import Data.Time (getCurrentTime, addUTCTime)+import Data.Time.Clock (diffUTCTime, UTCTime(..)) import Data.FileStore import System.Log.Logger (logM, Priority(..)) @@ -110,9 +111,9 @@ randomPage = do fs <- getFileStore files <- liftIO $ index fs- let pages = map dropExtension $- filter (\f -> isPageFile f && not (isDiscussPageFile f)) files base' <- getWikiBase+ let pages = map dropExtension $+ filter (\f -> isPageFile f && not (isDiscussPageFile f)) files if null pages then error "No pages found!" else do@@ -768,7 +769,7 @@ let file = (path' `orIfNull` "_site") <.> "feed" let mbPath = if null path' then Nothing else Just path' -- first, check for a cached version that is recent enough- now <- liftIO $ getCurrentTime+ now <- liftIO getCurrentTime let isRecentEnough t = truncate (diffUTCTime now t) < 60 * feedRefreshTime cfg mbCached <- lookupCache file case mbCached of
gitit.cabal view
@@ -1,5 +1,5 @@ name: gitit-version: 0.10.1+version: 0.10.1.1 Cabal-version: >= 1.6 build-type: Simple synopsis: Wiki using happstack, git or darcs, and pandoc.@@ -138,7 +138,7 @@ pandoc-types >= 1.9.0.2 && < 1.10, process, filepath,- directory >= 1.2,+ directory, mtl, cgi, old-time,