Gentoo Archives: gentoo-commits

From: "Mark Wright (gienah)" <gienah@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] gentoo-x86 commit in dev-haskell/hashed-storage/files: hashed-storage-0.5.9-ghc-7.6.patch
Date: Sat, 29 Dec 2012 13:38:04
Message-Id: 20121229133741.A8CC72171E@flycatcher.gentoo.org
1 gienah 12/12/29 13:37:41
2
3 Added: hashed-storage-0.5.9-ghc-7.6.patch
4 Log:
5 Patch hashed-storage-0.5.9 for ghc 7.6.1
6
7 (Portage version: 2.1.11.38/cvs/Linux x86_64, signed Manifest commit with key 618E971F)
8
9 Revision Changes Path
10 1.1 dev-haskell/hashed-storage/files/hashed-storage-0.5.9-ghc-7.6.patch
11
12 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/dev-haskell/hashed-storage/files/hashed-storage-0.5.9-ghc-7.6.patch?rev=1.1&view=markup
13 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/dev-haskell/hashed-storage/files/hashed-storage-0.5.9-ghc-7.6.patch?rev=1.1&content-type=text/plain
14
15 Index: hashed-storage-0.5.9-ghc-7.6.patch
16 ===================================================================
17 --- hashed-storage-0.5.9-orig/Storage/Hashed/Tree.hs 2011-10-09 07:47:55.000000000 +1100
18 +++ hashed-storage-0.5.9/Storage/Hashed/Tree.hs 2012-09-15 00:38:24.233669282 +1000
19 @@ -41,6 +41,7 @@
20 import Data.List( union, sort )
21 import Control.Monad( filterM, liftM )
22 import Control.Applicative( (<$>) )
23 +import qualified Control.Exception ( catch, IOException )
24
25 --------------------------------
26 -- Tree, Blob and friends
27 @@ -195,7 +196,7 @@
28 let
29 subtree (name, sub) =
30 do let here = path `appendPath` name
31 - sub' <- (Just <$> unstub sub) `catch` \_ -> return Nothing
32 + sub' <- (Just <$> unstub sub) `Control.Exception.catch` \(_ :: Control.Exception.IOException) -> return Nothing
33 case sub' of
34 Nothing -> return $ Left [(here, treeHash t_, Nothing)]
35 Just sub -> do
36 @@ -204,10 +205,10 @@
37 Left problems -> Left problems
38 Right tree -> Right (name, SubTree tree)
39 badBlob (_, f@(File (Blob s h))) =
40 - fmap (/= h) (hashFunc f `catch` (\_ -> return NoHash))
41 + fmap (/= h) (hashFunc f `Control.Exception.catch` (\(_ :: Control.Exception.IOException) -> return NoHash))
42 badBlob _ = return False
43 render (name, f@(File (Blob _ h))) = do
44 - h' <- (Just <$> hashFunc f) `catch` \_ -> return Nothing
45 + h' <- (Just <$> hashFunc f) `Control.Exception.catch` \(_ :: Control.Exception.IOException) -> return Nothing
46 return (path `appendPath` name, h, h')
47 subs <- mapM subtree [ x | x@(_, item) <- listImmediate t_, isSub item ]
48 badBlobs <- filterM badBlob (listImmediate t) >>= mapM render
49 --- hashed-storage-0.5.9-orig/Storage/Hashed/Darcs.hs 2011-10-09 07:47:55.000000000 +1100
50 +++ hashed-storage-0.5.9/Storage/Hashed/Darcs.hs 2012-09-15 00:40:02.693038029 +1000
51 @@ -1,4 +1,4 @@
52 -{-# LANGUAGE BangPatterns #-}
53 +{-# LANGUAGE BangPatterns, ScopedTypeVariables #-}
54
55 -- | A few darcs-specific utility functions. These are used for reading and
56 -- writing darcs and darcs-compatible hashed trees.
57 @@ -10,6 +10,7 @@
58 import System.Directory( doesFileExist )
59 import Codec.Compression.GZip( decompress, compress )
60 import Control.Applicative( (<$>) )
61 +import qualified Control.Exception ( catch, IOException )
62
63 import qualified Data.ByteString.Char8 as BS8
64 import qualified Data.ByteString.Lazy.Char8 as BL8
65 @@ -290,7 +291,7 @@
66
67 darcsPristineRefs :: FileSegment -> IO [Hash]
68 darcsPristineRefs fs = do
69 - con <- (darcsParseDir <$> readSegment fs) `catch` \_ -> return []
70 + con <- (darcsParseDir <$> readSegment fs) `Control.Exception.catch` \(_ :: Control.Exception.IOException) -> return []
71 return $! [ hash | (_, _, _, hash) <- con, valid hash ]
72 where valid NoHash = False
73 valid _ = True