[Pkg-haskell-commits] darcs: haskell-hoogle: No more use dwww

kiwamu at debian.or.jp kiwamu at debian.or.jp
Wed Sep 12 16:08:22 UTC 2012


Wed Sep 12 16:05:31 UTC 2012  kiwamu at debian.or.jp
  * No more use dwww
  Ignore-this: 430c46bb349f3671062ba1d4ce2e6469

    M ./control -1 +1
    M ./files_hoogle/hoogle.conf -10
    M ./files_hoogle/update-hoogle -1 +1
    A ./patches/cgi-return-res-files.patch
    M ./patches/series +1
    M ./rules -1 +1

Wed Sep 12 16:05:31 UTC 2012  kiwamu at debian.or.jp
  * No more use dwww
  Ignore-this: 430c46bb349f3671062ba1d4ce2e6469
diff -rN -u old-haskell-hoogle//control new-haskell-hoogle//control
--- old-haskell-hoogle//control	2012-09-12 16:08:21.801827479 +0000
+++ new-haskell-hoogle//control	2012-09-12 16:08:21.805830360 +0000
@@ -117,7 +117,7 @@
 Architecture: any
 Section: misc
 Depends: ${shlibs:Depends}, ${haskell:Depends}, ${misc:Depends}, ghc-doc
-Recommends: apache2, dwww
+Recommends: apache2
 Description: Haskell API Search for Debian system
  Hoogle is a Haskell API search engine, which allows you to
  search many standard Haskell libraries by either function name,
diff -rN -u old-haskell-hoogle//files_hoogle/hoogle.conf new-haskell-hoogle//files_hoogle/hoogle.conf
--- old-haskell-hoogle//files_hoogle/hoogle.conf	2012-09-12 16:08:21.801827479 +0000
+++ new-haskell-hoogle//files_hoogle/hoogle.conf	2012-09-12 16:08:21.809827158 +0000
@@ -1,15 +1,5 @@
 # Apache config for hoogle
 
-# resource dir
-Alias /hoogle/ /usr/share/hoogle/resources/
-<Directory "/usr/share/hoogle/resources">
-    Options -Indexes FollowSymLinks MultiViews
-    AllowOverride None
-    order deny,allow
-    deny from all
-    allow from localhost 127.0.0.1
-</Directory>
-
 # Disable execution of hoogle from remote hosts
 <Location /cgi-bin/hoogle>
     order deny,allow
diff -rN -u old-haskell-hoogle//files_hoogle/update-hoogle new-haskell-hoogle//files_hoogle/update-hoogle
--- old-haskell-hoogle//files_hoogle/update-hoogle	2012-09-12 16:08:21.801827479 +0000
+++ new-haskell-hoogle//files_hoogle/update-hoogle	2012-09-12 16:08:21.813825412 +0000
@@ -2,7 +2,7 @@
 
 DATABASE_DIR=/var/lib/hoogle/databases
 HOOGLE=/usr/bin/hoogle
-URLPREFIX=http://localhost/cgi-bin/dwww
+URLPREFIX=http://localhost/cgi-bin/hoogle/file
 
 # cleanup
 rm -rf $DATABASE_DIR/*
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	1970-01-01 00:00:00.000000000 +0000
+++ new-haskell-hoogle//patches/cgi-return-res-files.patch	2012-09-12 16:08:21.821826944 +0000
@@ -0,0 +1,48 @@
+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
+@@ -1,6 +1,6 @@
+ {-# LANGUAGE RecordWildCards, ScopedTypeVariables, PatternGuards #-}
+ 
+-module Web.Server(server) where
++module Web.Server(server, serveFile) where
+ 
+ import General.Base
+ 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
+@@ -2,11 +2,13 @@
+ module Web.All(action) where
+ 
+ import CmdLine.All
++import General.System
+ import General.Base
+ import General.Web
+ import Web.Server
+ import Web.Response
+ import Web.Page
++import Network.Wai
+ import Paths_hoogle
+ 
+ 
+@@ -15,4 +17,16 @@
+ action q = do
+   f <- readFile' =<< getDataFileName ("resources" </> "template" <.> "html")
+   let t = loadTemplates f
+-  cgiResponse =<< response responseArgs{templates=t} q
++  d <- getDataDir
++  p <- getEnvVar "PATH_INFO"
++  let p' = fromMaybe "" p
++  cgiResponse =<< go t d p'
++    where
++      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))
++      go t _ _ = response responseArgs{templates=t} q
++
++rewriteRootLinks :: Response -> IO Response
++rewriteRootLinks = responseRewrite $ lbsReplace (fromString "href=\"/") (fromString "href=\"/cgi-bin/hoogle/file/")
diff -rN -u old-haskell-hoogle//patches/series new-haskell-hoogle//patches/series
--- old-haskell-hoogle//patches/series	2012-09-12 16:08:21.801827479 +0000
+++ new-haskell-hoogle//patches/series	2012-09-12 16:08:21.825827233 +0000
@@ -1,3 +1,4 @@
 no-log.patch
 cgi-use-template-file-always.patch
 ad-hoc-extend-depend-4-2-10.patch
+cgi-return-res-files.patch
diff -rN -u old-haskell-hoogle//rules new-haskell-hoogle//rules
--- old-haskell-hoogle//rules	2012-09-12 16:08:21.801827479 +0000
+++ new-haskell-hoogle//rules	2012-09-12 16:08:21.825827233 +0000
@@ -11,7 +11,7 @@
 	cd $(FILES_HOOGLE)/ && strip haddock_collect
 
 binary-fixup/hoogle::
-	sed -i -e "s/res\//\/hoogle\//g" $(HOOGLE_RESDIR)/template.html
+	sed -i -e "s/res\//hoogle\/res\//g" $(HOOGLE_RESDIR)/template.html
 	sed -i -e "s/action=\"\.\"/action=\"\.\/hoogle\"/g" $(HOOGLE_RESDIR)/template.html
 	install $(FILES_HOOGLE)/update-hoogle debian/hoogle/usr/sbin/
 	install $(FILES_HOOGLE)/haddock_collect debian/hoogle/usr/sbin/





More information about the Pkg-haskell-commits mailing list