[Pkg-haskell-commits] darcs: haskell-hoogle: redirect / to /index.html

kiwamu at debian.or.jp kiwamu at debian.or.jp
Sun Sep 30 13:32:47 UTC 2012


Sun Sep 30 13:29:39 UTC 2012  kiwamu at debian.or.jp
  * redirect / to /index.html
  Ignore-this: 42132c82335237c6eab7dc20ade6d3ad

    M ./patches/cgi-return-res-files.patch -6 +7

Sun Sep 30 13:29:39 UTC 2012  kiwamu at debian.or.jp
  * redirect / to /index.html
  Ignore-this: 42132c82335237c6eab7dc20ade6d3ad
diff -rN -u old-haskell-hoogle//patches/cgi-return-res-files.patch new-haskell-hoogle//patches/cgi-return-res-files.patch
--- old-haskell-hoogle//patches/cgi-return-res-files.patch	2012-09-30 13:32:47.386125608 +0000
+++ new-haskell-hoogle//patches/cgi-return-res-files.patch	2012-09-30 13:32:47.402442910 +0000
@@ -1,7 +1,7 @@
 Index: haskell-hoogle-4.2.10/src/Web/Server.hs
 ===================================================================
---- haskell-hoogle-4.2.10.orig/src/Web/Server.hs	2012-09-12 23:25:05.160049446 +0900
-+++ haskell-hoogle-4.2.10/src/Web/Server.hs	2012-09-12 23:26:48.840563557 +0900
+--- haskell-hoogle-4.2.10.orig/src/Web/Server.hs	2012-09-13 10:00:53.975656209 +0900
++++ haskell-hoogle-4.2.10/src/Web/Server.hs	2012-09-13 16:29:32.680340578 +0900
 @@ -1,6 +1,6 @@
  {-# LANGUAGE RecordWildCards, ScopedTypeVariables, PatternGuards #-}
  
@@ -12,8 +12,8 @@
  import General.Web
 Index: haskell-hoogle-4.2.10/src/Web/All.hs
 ===================================================================
---- haskell-hoogle-4.2.10.orig/src/Web/All.hs	2012-09-12 23:15:40.000000000 +0900
-+++ haskell-hoogle-4.2.10/src/Web/All.hs	2012-09-13 00:33:29.494184336 +0900
+--- haskell-hoogle-4.2.10.orig/src/Web/All.hs	2012-09-13 16:29:32.648340414 +0900
++++ haskell-hoogle-4.2.10/src/Web/All.hs	2012-09-22 15:01:38.137179335 +0900
 @@ -2,11 +2,13 @@
  module Web.All(action) where
  
@@ -28,7 +28,7 @@
  import Paths_hoogle
  
  
-@@ -15,4 +17,16 @@
+@@ -15,4 +17,17 @@
  action q = do
    f <- readFile' =<< getDataFileName ("resources" </> "template" <.> "html")
    let t = loadTemplates f
@@ -41,7 +41,8 @@
 +      go t d p | "/res/" `isPrefixOf` p =
 +        serveFile True $ d </> "resources" </> takeFileName p
 +      go t d p | "/file/usr/share/doc/" `isPrefixOf` p =
-+        rewriteRootLinks =<< serveFile False (fromJust (stripPrefix "/file" p))
++        let p' = if "/" `isSuffixOf` p then p ++ "index.html" else p
++        in rewriteRootLinks =<< serveFile False (fromJust (stripPrefix "/file" p'))
 +      go t _ _ = response responseArgs{templates=t} q
 +
 +rewriteRootLinks :: Response -> IO Response





More information about the Pkg-haskell-commits mailing list