@@ -0,0 +1,240 @@
1+diff -ru orig/datadir/resources/search.xml new/datadir/resources/search.xml
2+--- orig/datadir/resources/search.xml 2013-12-04 19:36:25.391122832 +0200
3++++ new/datadir/resources/search.xml 2013-12-04 19:36:25.000000000 +0200
4+@@ -11,8 +11,8 @@
5+ <Url type="text/html" template="http://haskell.org/hoogle/?hoogle={searchTerms}"/>
6+ <Url type="application/x-suggestions+json" template="http://haskell.org/hoogle/?hoogle={searchTerms}&mode=suggest"/>
7+
8+- <Image height="16" width="16" type="image/png">http://haskell.org/hoogle/datadir/resources/favicon.png</Image>
9+- <Image height="64" width="64" type="image/png">http://haskell.org/hoogle/datadir/resources/favicon64.png</Image>
10++ <Image height="16" width="16" type="image/png">http://haskell.org/hoogle/res/favicon.png</Image>
11++ <Image height="64" width="64" type="image/png">http://haskell.org/hoogle/res/favicon64.png</Image>
12+ <Developer>Neil Mitchell</Developer>
13+ <AdultContent>false</AdultContent>
14+ <Language>en-us</Language>
15+diff -ru orig/hoogle.cabal new/hoogle.cabal
16+--- orig/hoogle.cabal 2013-12-04 19:36:25.395122833 +0200
17++++ new/hoogle.cabal 2013-12-04 19:36:25.000000000 +0200
18+@@ -15,7 +15,7 @@
19+ or by approximate type signature.
20+ homepage: http://www.haskell.org/hoogle/
21+ bug-reports: https://github.com/ndmitchell/hoogle/issues
22+-stability: Beta
23++tested-with: GHC==7.6.3, GHC==7.4.2, GHC==7.2.2
24+ extra-source-files: README.txt
25+ datadir/*.txt
26+
27+@@ -72,8 +72,8 @@
28+ Hoogle.Language.Haskell
29+
30+ other-modules:
31+- Data.Heap
32+- Data.TypeMap
33++ General.Heap
34++ General.TypeMap
35+ General.Base
36+ General.System
37+ General.Util
38+@@ -172,17 +172,9 @@
39+ Web.Template
40+
41+ test-suite hoogle-test
42+- main-is: HoogleSpec.hs
43+- hs-source-dirs: test
44++ main-is: Test.hs
45++ hs-source-dirs: src
46+ default-language: Haskell98
47+
48+ type: exitcode-stdio-1.0
49+- build-depends:
50+- base >=3,
51+- hoogle,
52+- conduit >= 0.2,
53+- system-fileio >= 0.3.11,
54+- transformers >= 0.2,
55+- HUnit >= 1.2.5,
56+- hspec >= 1.4.4,
57+- hspec-expectations >= 0.3
58++ build-depends: base >= 3, process, directory, filepath
59+diff -ru orig/src/Console/All.hs new/src/Console/All.hs
60+--- orig/src/Console/All.hs 2013-12-04 19:36:25.387122831 +0200
61++++ new/src/Console/All.hs 2013-12-04 19:36:25.000000000 +0200
62+@@ -29,10 +29,9 @@
63+ action (Test files _) = do
64+ testPrepare
65+ fails <- fmap sum $ mapM (testFile action) files
66+- putStrLn $
67+- if fails == 0
68+- then "Tests passed"
69+- else "TEST FAILURES (" ++ show fails ++ ")"
70++ if fails == 0 then putStrLn "Tests passed" else do
71++ putStrLn $ "TEST FAILURES (" ++ show fails ++ ")"
72++ exitFailure
73+
74+ action (Rank file) = rank file
75+
76+diff -ru orig/src/Console/Test.hs new/src/Console/Test.hs
77+--- orig/src/Console/Test.hs 2013-12-04 19:36:25.387122831 +0200
78++++ new/src/Console/Test.hs 2013-12-04 19:36:25.000000000 +0200
79+@@ -22,6 +22,7 @@
80+ putStrLn "Converting testdata"
81+ performGC -- clean up the databases
82+ dat <- getDataDir
83++ createDirectoryIfMissing True $ dat </> "databases"
84+ src <- readFileUtf8 $ dat </> "testdata.txt"
85+ let (errs, dbOld) = createDatabase Haskell [] src
86+ unless (null errs) $ error $ unlines $ "Couldn't convert testdata database:" : map show errs
87+Only in orig/src: Data
88+Only in new/src/General: Heap.hs
89+Only in new/src/General: TypeMap.hs
90+diff -ru orig/src/General/Web.hs new/src/General/Web.hs
91+--- orig/src/General/Web.hs 2013-12-04 19:36:25.387122831 +0200
92++++ new/src/General/Web.hs 2013-12-04 19:36:25.000000000 +0200
93+@@ -1,3 +1,4 @@
94++{-# LANGUAGE CPP #-}
95+ {-# LANGUAGE PatternGuards #-}
96+
97+ {- |
98+@@ -15,6 +16,9 @@
99+ import General.System
100+ import General.Base
101+ import Network.Wai
102++#if MIN_VERSION_wai(2, 0, 0)
103++import Network.Wai.Internal
104++#endif
105+ import Network.HTTP.Types
106+ import Data.CaseInsensitive(original)
107+ import qualified Data.ByteString.Lazy.Char8 as LBS
108+@@ -34,10 +38,17 @@
109+
110+ responseFlatten :: Response -> IO (Status, ResponseHeaders, LBString)
111+ responseFlatten r = do
112++#if MIN_VERSION_wai(2, 0, 0)
113++ let (s,hs,withSrc) = responseToSource r
114++ chunks <- withSrc $ \src -> src $$ consume
115++ let res = toLazyByteString $ mconcat [x | Chunk x <- chunks]
116++ return (s,hs,res)
117++#else
118+ let (s,hs,rest) = responseSource r
119+ chunks <- runResourceT $ rest $$ consume
120+ let res = toLazyByteString $ mconcat [x | Chunk x <- chunks]
121+ return (s,hs,res)
122++#endif
123+
124+
125+ responseEvaluate :: Response -> IO ()
126+diff -ru orig/src/Hoogle/DataBase/TypeSearch/Graphs.hs new/src/Hoogle/DataBase/TypeSearch/Graphs.hs
127+--- orig/src/Hoogle/DataBase/TypeSearch/Graphs.hs 2013-12-04 19:36:25.387122831 +0200
128++++ new/src/Hoogle/DataBase/TypeSearch/Graphs.hs 2013-12-04 19:36:25.000000000 +0200
129+@@ -11,7 +11,7 @@
130+
131+ import Hoogle.Store.All
132+ import qualified Data.IntMap as IntMap
133+-import qualified Data.Heap as Heap
134++import qualified General.Heap as Heap
135+ import General.Base
136+ import General.Util
137+ import Control.Monad.Trans.State
138+diff -ru orig/src/Recipe/Download.hs new/src/Recipe/Download.hs
139+--- orig/src/Recipe/Download.hs 2013-12-04 19:36:25.383122832 +0200
140++++ new/src/Recipe/Download.hs 2013-12-04 19:36:25.000000000 +0200
141+@@ -47,8 +47,8 @@
142+ , (inputs <.> "txt", inputs <.> "tar.gz", "http://old.hackage.haskell.org/packages/archive/00-hoogle.tar.gz")
143+ ]
144+ withDownloader opt downloader items
145+- extractTarball cabals
146+- extractTarball inputs
147++ doesFileExist (cabals <.> "tar.gz") >>= \b -> when b $ extractTarball cabals
148++ doesFileExist (inputs <.> "tar.gz") >>= \b -> when b $ extractTarball inputs
149+
150+
151+ check :: String -> IO (Maybe FilePath)
152+diff -ru orig/src/Recipe/Keyword.hs new/src/Recipe/Keyword.hs
153+--- orig/src/Recipe/Keyword.hs 2013-12-04 19:36:25.383122832 +0200
154++++ new/src/Recipe/Keyword.hs 2013-12-04 19:36:25.000000000 +0200
155+@@ -13,10 +13,9 @@
156+
157+ translate :: String -> String
158+ translate src = unlines $ keywordPrefix ++ items
159+- where items = concatMap keywordFormat $ drop 1 $ partitions (~== "<a name>") $
160++ where items = concatMap keywordFormat $ partitions (~== "<span class='mw-headline' id>") $
161+ takeWhile (~/= "<div class=printfooter>") $ parseTags src
162+
163+-
164+ keywordPrefix =
165+ ["-- Hoogle documentation, generated by Hoogle"
166+ ,"-- From http://www.haskell.org/haskellwiki/Keywords"
167+@@ -33,17 +32,16 @@
168+ noUnderscore "_" = "_"
169+ noUnderscore xs = map (\x -> if x == '_' then ' ' else x) xs
170+
171+- name = words $ f $ fromAttrib "name" (head x)
172++ name = words $ f $ fromAttrib "id" (head x)
173+ docs = zipWith (++) ("-- | " : repeat "-- ") $
174+ intercalate [""] $
175+- map (docFormat . takeWhile (~/= "<div class=editsection>")) $
176++ map docFormat $
177+ partitions isBlock x
178+
179+ g x | isAlpha x || x `elem` "_-:" = [x]
180+ | otherwise = '.' : map toUpper (showHex (ord x) "")
181+
182+-
183+- isBlock (TagOpen x _) = x `elem` ["p","pre"]
184++ isBlock (TagOpen x _) = x `elem` ["p","pre","ul"]
185+ isBlock _ = False
186+
187+ f ('.':'2':'C':'_':xs) = ' ' : f xs
188+@@ -56,7 +54,7 @@
189+ docFormat :: [Tag String] -> [String]
190+ docFormat (TagOpen "pre" _:xs) = ["<pre>"] ++ map (drop n) ys ++ ["</pre>"]
191+ where
192+- ys = lines $ innerText xs
193++ ys = lines $ reverse $ dropWhile isSpace $ reverse $ innerText xs
194+ n = minimum $ map (length . takeWhile isSpace) ys
195+
196+ docFormat (TagOpen "p" _:xs) = g 0 [] $ words $ f xs
197+@@ -73,3 +71,6 @@
198+
199+ h (TagText x) = unwords (lines x)
200+ h _ = ""
201++
202++docFormat (TagOpen "ul" _:xs) =
203++ ["<ul><li>"] ++ intercalate ["</li><li>"] [docFormat (TagOpen "p" []:x) | x <- partitions (~== "<li>") xs] ++ ["</li></ul>"]
204+Only in new/src: Test.hs
205+diff -ru orig/src/Web/Server.hs new/src/Web/Server.hs
206+--- orig/src/Web/Server.hs 2013-12-04 19:36:25.379122832 +0200
207++++ new/src/Web/Server.hs 2013-12-04 19:36:25.000000000 +0200
208+@@ -1,4 +1,4 @@
209+-{-# LANGUAGE RecordWildCards, ScopedTypeVariables, PatternGuards #-}
210++{-# LANGUAGE RecordWildCards, ScopedTypeVariables, PatternGuards, CPP #-}
211+
212+ module Web.Server(server) where
213+
214+@@ -16,6 +16,9 @@
215+ import Data.Time.Clock
216+
217+ import Network.Wai
218++#if MIN_VERSION_wai(2, 0, 0)
219++import Network.Wai.Internal
220++#endif
221+ import Network.Wai.Handler.Warp
222+
223+
224+@@ -34,9 +37,15 @@
225+ return res
226+
227+
228++#if MIN_VERSION_wai(2, 0, 0)
229++exception :: Maybe Request -> SomeException -> IO ()
230++exception _ e | Just (_ :: InvalidRequest) <- fromException e = return ()
231++ | otherwise = putStrLn $ "Error: " ++ show e
232++#else
233+ exception :: SomeException -> IO ()
234+ exception e | Just (_ :: InvalidRequest) <- fromException e = return ()
235+ | otherwise = putStrLn $ "Error: " ++ show e
236++#endif
237+
238+
239+ respArgs :: CmdLine -> IO (IO ResponseArgs)
240+Only in orig: test