From: pho Date: Fri, 28 Mar 2008 07:38:42 +0000 (+0900) Subject: /dumpRepos X-Git-Url: https://git.cielonegro.org/gitweb.cgi?a=commitdiff_plain;h=10200315228e613ca2de0b2a5c5e792e721b4ab6;p=Rakka.git /dumpRepos darcs-hash:20080328073842-62b54-ac916d3da4f16bbef84f5af9e2cabcaea294bc9a.gz --- diff --git a/Main.hs b/Main.hs index 02a4cf4..c4bb048 100644 --- a/Main.hs +++ b/Main.hs @@ -7,6 +7,7 @@ import Network.HTTP.Lucu import OpenSSL import Rakka.Environment import Rakka.Resource.CheckAuth +import Rakka.Resource.DumpRepos import Rakka.Resource.Index import Rakka.Resource.JavaScript import Rakka.Resource.PageEntity @@ -144,6 +145,7 @@ resTree :: Environment -> ResTree resTree env = mkResTree [ ([] , resIndex env) , (["checkAuth" ], resCheckAuth env) + , (["dumpRepos" ], resDumpRepos env) , (["js" ], javaScript ) , (["object" ], resObject env) , (["render" ], resRender env) diff --git a/Rakka.cabal b/Rakka.cabal index 0e0ed45..384a3e9 100644 --- a/Rakka.cabal +++ b/Rakka.cabal @@ -58,8 +58,8 @@ Flag hardest-optimization Executable rakka Build-Depends: - FileManip, HTTP, HUnit, HsHyperEstraier, HsOpenSSL, HsSVN, - Lucu, base, bytestring, containers, dataenc, directory, + FileManip, HTTP, HUnit, HsHyperEstraier, HsOpenSSL, HsSVN >= + 0.3.1, Lucu, base, bytestring, containers, dataenc, directory, utf8-string, filepath, hslogger, hxt, magic, mtl, network, parsec, stm, time, unix, zlib Main-Is: @@ -71,6 +71,7 @@ Executable rakka Rakka.Page Rakka.Resource Rakka.Resource.CheckAuth + Rakka.Resource.DumpRepos Rakka.Resource.Index Rakka.Resource.JavaScript Rakka.Resource.Object diff --git a/Rakka/Resource/DumpRepos.hs b/Rakka/Resource/DumpRepos.hs new file mode 100644 index 0000000..068528a --- /dev/null +++ b/Rakka/Resource/DumpRepos.hs @@ -0,0 +1,29 @@ +module Rakka.Resource.DumpRepos + ( resDumpRepos + ) + where + +import Control.Monad.Trans +import Network.HTTP.Lucu +import Rakka.Environment +import Subversion.Repository + +resDumpRepos :: Environment -> ResourceDef +resDumpRepos env + = ResourceDef { + resUsesNativeThread = False + , resIsGreedy = False + , resGet = Just $ dumpRepos $ envRepository env + , resHead = Nothing + , resPost = Nothing + , resPut = Nothing + , resDelete = Nothing + } + + +dumpRepos :: Repository -> Resource () +dumpRepos repos + = do setContentType $ read "application/octet-stream" + -- FIXME: 最終更新時刻が判るはず。 + dump <- liftIO $ dumpRepository repos Nothing Nothing False True + outputLBS dump