hoogle 4.2.9 → 4.2.10
raw patch · 3 files changed
+26/−19 lines, 3 filesPVP ok
version bump matches the API change (PVP)
API changes (from Hackage documentation)
Files
- hoogle.cabal +1/−1
- src/Recipe/Cabal.hs +18/−14
- src/Recipe/Hackage.hs +7/−4
hoogle.cabal view
@@ -1,7 +1,7 @@ cabal-version: >= 1.6 build-type: Simple name: hoogle-version: 4.2.9+version: 4.2.10 license: GPL license-file: docs/LICENSE category: Development
src/Recipe/Cabal.hs view
@@ -13,9 +13,11 @@ import Distribution.Verbosity import Distribution.Version import Recipe.Haddock+import Recipe.Type+import Control.Exception -ghcVersion = [7,0,1]+ghcVersion = [7,4,1] data Cabal = Cabal {cabalName :: String@@ -25,16 +27,18 @@ } deriving Show -readCabal :: FilePath -> IO Cabal-readCabal file = do- pkg <- readPackageDescription silent file- let plat = Platform I386 Linux- comp = CompilerId GHC (Version ghcVersion [])- pkg <- return $ case finalizePackageDescription [] (const True) plat comp [] pkg of- Left _ -> flattenPackageDescription pkg- Right (pkg,_) -> pkg- return $ Cabal- (display $ pkgName $ package pkg)- (display $ pkgVersion $ package pkg)- (haddockToHTML $ description pkg)- [display x | Just l <- [library pkg], Dependency x _ <- targetBuildDepends $ libBuildInfo l]+readCabal :: FilePath -> IO (Maybe Cabal)+readCabal file = handle (\e -> do+ putWarning $ "Failure when reading " ++ file ++ ", " ++ show (e :: SomeException)+ return Nothing) $ fmap Just $ do+ pkg <- readPackageDescription silent file+ let plat = Platform I386 Linux+ comp = CompilerId GHC (Version ghcVersion [])+ pkg <- return $ case finalizePackageDescription [] (const True) plat comp [] pkg of+ Left _ -> flattenPackageDescription pkg+ Right (pkg,_) -> pkg+ return $ Cabal+ (display $ pkgName $ package pkg)+ (display $ pkgVersion $ package pkg)+ (haddockToHTML $ description pkg)+ [display x | Just l <- [library pkg], Dependency x _ <- targetBuildDepends $ libBuildInfo l]
src/Recipe/Hackage.hs view
@@ -38,8 +38,11 @@ ver <- version cabals name let file = cabals </> name </> ver </> name <.> "cabal" src <- readCabal file- return $ [""] ++ zipWith (++) ("-- | " : repeat "-- ") (cabalDescription src) ++- ["--","-- Version " ++ ver, "@url package/" ++ name, "@entry package " ++ name]+ return $ case src of+ Nothing -> []+ Just src ->+ [""] ++ zipWith (++) ("-- | " : repeat "-- ") (cabalDescription src) +++ ["--","-- Version " ++ ver, "@url package/" ++ name, "@entry package " ++ name] convertSrc noDeps "package" $ unlines $ "@url http://hackage.haskell.org/" : "@package package" : concat xs @@ -71,10 +74,10 @@ case had of Left e -> putWarning $ "Warning: Exception when reading haddock for " ++ name ++ ", " ++ show (e :: SomeException) Right had -> do- cab <- readCabal cab+ deps <- fmap (maybe [] cabalDepends) $ readCabal cab loc <- findLocal local name convertSrc make name $ unlines $- ["@depends " ++ a | a <- cabalDepends cab \\ (name:avoid)] +++ ["@depends " ++ a | a <- deps \\ (name:avoid)] ++ (maybe id haddockPackageUrl loc) (haddockHacks $ lines had)