]> gitweb @ CieloNegro.org - Rakka.git/blobdiff - Rakka/Storage/Repos.hs
Fixing build breakage...
[Rakka.git] / Rakka / Storage / Repos.hs
index 8664d2480d5b62252b5930e43dbee309a21fe204..ae4ce706d9f1a04f014b5e94d813e0476e71797f 100644 (file)
@@ -1,3 +1,4 @@
+-- -*- coding: utf-8 -*-
 module Rakka.Storage.Repos
     ( findAllPagesInRevision
     , getDirContentsInRevision
@@ -9,8 +10,6 @@ module Rakka.Storage.Repos
     , putAttachmentIntoRepository
     )
     where
-
-import           Codec.Binary.UTF8.String
 import           Control.Monad
 import           Data.List
 import qualified Data.Map as M
@@ -18,12 +17,12 @@ import           Data.Maybe
 import           Data.Set (Set)
 import qualified Data.Set as S hiding (Set)
 import           Data.Time
+import qualified Data.Time.W3C as W3C
 import           Network.HTTP.Lucu hiding (redirect)
 import           Rakka.Attachment
 import           Rakka.Page
 import           Rakka.SystemConfig
 import           Rakka.Utils
-import           Rakka.W3CDateTime
 import           Subversion.FileSystem
 import           Subversion.FileSystem.DirEntry
 import           Subversion.FileSystem.Revision
@@ -162,7 +161,7 @@ loadPageInRepository repos name rev
                               $ fmap chomp (lookup "svn:mime-type" props)
 
                lastMod <- unsafeIOToFS $
-                          liftM (fromJust . parseW3CDateTime . chomp . fromJust)
+                          liftM (fromJust . W3C.parse . chomp . fromJust)
                                 (getRevisionProp' fs pageRev "svn:date")
 
                return Entity {
@@ -197,7 +196,7 @@ loadPageInRepository repos name rev
                    dest    = chomp $ decodeString content
 
                lastMod <- unsafeIOToFS $
-                          liftM (fromJust . parseW3CDateTime . chomp . fromJust)
+                          liftM (fromJust . W3C.parse . chomp . fromJust)
                                 (getRevisionProp' fs pageRev "svn:date")
 
                isLocked <- liftM isJust (getNodeProp path "rakka:isLocked")
@@ -374,7 +373,7 @@ deletePageFromRepository repos userID name
                           else
                             return NotFound
          when (status == NoContent)
-             $ do doReposTxn repos
+             $ ( (doReposTxn repos
                              rev
                              "[Rakka]"
                              (Just "Automatic commit by Rakka for page deleting")
@@ -384,8 +383,8 @@ deletePageFromRepository repos userID name
                                   attachmentExists <- isDirectory attachmentPath
                                   when attachmentExists
                                       $ do deleteEntry attachmentPath
-                                           deleteEmptyParentDirectories attachmentPath
-                  return ()
+                                           deleteEmptyParentDirectories attachmentPath)
+                 >> return () )
          return status
 
 
@@ -447,7 +446,7 @@ putAttachmentIntoRepository repos userID oldRev pName aName attachment
                      unless exists
                          $ do createParentDirectories path
                               makeFile path
-                     applyText path Nothing (serializeToString attachment)
+                     applyText path Nothing (encodeString $ serializeToString attachment)
          case ret of
            Left  _ -> return Conflict
            Right _ -> return NoContent