1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
|
--- MissingH-1.1.1.0-orig/src/Network/Email/Sendmail.hs 2011-09-07 23:57:11.000000000 +1000
+++ MissingH-1.1.1.0/src/Network/Email/Sendmail.hs 2012-09-13 00:55:20.232608257 +1000
@@ -34,6 +34,7 @@
import System.Directory
import System.IO
import System.IO.Error
+import qualified Control.Exception(try, IOException)
sendmails :: [String]
sendmails = ["/usr/sbin/sendmail",
@@ -90,10 +91,10 @@
in
do
--pOpen WriteToPipe "/usr/sbin/sendmail" args func
- rv <- try (pOpen WriteToPipe "sendmail" args func)
+ rv <- Control.Exception.try (pOpen WriteToPipe "sendmail" args func)
case rv of
Right x -> return x
- Left _ -> do
+ Left (_ :: Control.Exception.IOException) -> do
sn <- findsendmail
r <- pOpen WriteToPipe sn args func
return $! r
--- MissingH-1.1.1.0-orig/src/System/Cmd/Utils.hs 2011-09-07 23:57:11.000000000 +1000
+++ MissingH-1.1.1.0/src/System/Cmd/Utils.hs 2012-09-13 00:52:19.943988811 +1000
@@ -108,6 +108,7 @@
import System.IO.Error
import Control.Concurrent(forkIO)
import Control.Exception(finally)
+import qualified Control.Exception(try, IOException)
data PipeMode = ReadFromPipe | WriteToPipe
@@ -169,11 +170,11 @@
let childstuff = do dupTo (snd pipepair) stdOutput
closeFd (fst pipepair)
executeFile fp True args Nothing
- p <- try (forkProcess childstuff)
+ p <- Control.Exception.try (forkProcess childstuff)
-- parent
pid <- case p of
Right x -> return x
- Left e -> warnFail "pipeFrom" fp args $
+ Left (e :: Control.Exception.IOException) -> warnFail "pipeFrom" fp args $
"Error in fork: " ++ show e
closeFd (snd pipepair)
h <- fdToHandle (fst pipepair)
@@ -218,11 +219,11 @@
let childstuff = do dupTo (fst pipepair) stdInput
closeFd (snd pipepair)
executeFile fp True args Nothing
- p <- try (forkProcess childstuff)
+ p <- Control.Exception.try (forkProcess childstuff)
-- parent
pid <- case p of
Right x -> return x
- Left e -> warnFail "pipeTo" fp args $
+ Left (e :: Control.Exception.IOException) -> warnFail "pipeTo" fp args $
"Error in fork: " ++ show e
closeFd (fst pipepair)
h <- fdToHandle (snd pipepair)
@@ -274,11 +275,11 @@
dupTo (fst topair) stdInput
closeFd (snd topair)
executeFile fp True args Nothing
- p <- try (forkProcess childstuff)
+ p <- Control.Exception.try (forkProcess childstuff)
-- parent
pid <- case p of
Right x -> return x
- Left e -> warnFail "pipeBoth" fp args $
+ Left (e :: Control.Exception.IOException) -> warnFail "pipeBoth" fp args $
"Error in fork: " ++ show e
closeFd (snd frompair)
closeFd (fst topair)
@@ -546,10 +547,10 @@
-}
in
do
- p <- try (forkProcess childstuff)
+ p <- Control.Exception.try (forkProcess childstuff)
pid <- case p of
Right x -> return x
- Left e -> fail ("Error in fork: " ++ (show e))
+ Left (e :: Control.Exception.IOException) -> fail ("Error in fork: " ++ (show e))
return pid
#endif
--- MissingH-1.1.1.0-orig/src/Data/MIME/Types.hs 2011-09-07 23:57:11.000000000 +1000
+++ MissingH-1.1.1.0/src/Data/MIME/Types.hs 2012-09-13 00:48:23.464938387 +1000
@@ -35,6 +35,7 @@
where
import qualified Data.Map as Map
+import qualified Control.Exception (try, IOException)
import Control.Monad
import System.IO
import System.IO.Error
@@ -189,9 +190,9 @@
let tryread :: MIMETypeData -> String -> IO MIMETypeData
tryread inputobj filename =
do
- fn <- try (openFile filename ReadMode)
+ fn <- Control.Exception.try (openFile filename ReadMode)
case fn of
- Left _ -> return inputobj
+ Left (_ :: Control.Exception.IOException) -> return inputobj
Right h -> do
x <- hReadMIMETypes inputobj True h
hClose h
--- MissingH-1.1.1.0-orig/src/System/IO/HVFS.hs 2011-09-07 23:57:11.000000000 +1000
+++ MissingH-1.1.1.0/src/System/IO/HVFS.hs 2012-09-13 00:45:05.981893726 +1000
@@ -1,4 +1,4 @@
-{-# LANGUAGE CPP, TypeSynonymInstances #-}
+{-# LANGUAGE CPP, ScopedTypeVariables, TypeSynonymInstances #-}
{- arch-tag: HVFS main file
Copyright (c) 2004-2011 John Goerzen <jgoerzen@complete.org>
@@ -52,6 +52,7 @@
)
where
+import qualified Control.Exception (catch, IOException)
import System.IO.HVIO
import System.Time.Utils
import System.IO
@@ -61,6 +62,10 @@
import System.Time
import System.Directory
+#if MIN_VERSION_directory(1,2,0)
+import Data.Time.Clock.POSIX ( utcTimeToPOSIXSeconds )
+#endif
+
{- | Encapsulate a 'HVFSStat' result. This is required due to Haskell
typing restrictions. You can get at it with:
@@ -209,17 +214,17 @@
vSetCurrentDirectory fs _ = eh fs "vSetCurrentDirectory"
vGetDirectoryContents fs _ = eh fs "vGetDirectoryContents"
vDoesFileExist fs fp =
- catch (do s <- vGetFileStatus fs fp
- return $ withStat s vIsRegularFile
- ) (\_ -> return False)
+ Control.Exception.catch (do s <- vGetFileStatus fs fp
+ return $ withStat s vIsRegularFile
+ ) (\(_ :: Control.Exception.IOException) -> return False)
vDoesDirectoryExist fs fp =
- catch (do s <- vGetFileStatus fs fp
- return $ withStat s vIsDirectory
- ) (\_ -> return False)
+ Control.Exception.catch (do s <- vGetFileStatus fs fp
+ return $ withStat s vIsDirectory
+ ) (\(_ :: Control.Exception.IOException) -> return False)
vDoesExist fs fp =
- catch (do s <- vGetSymbolicLinkStatus fs fp
- return True
- ) (\_ -> return False)
+ Control.Exception.catch (do s <- vGetSymbolicLinkStatus fs fp
+ return True
+ ) (\(_ :: Control.Exception.IOException) -> return False)
vCreateDirectory fs _ = eh fs "vCreateDirectory"
vRemoveDirectory fs _ = eh fs "vRemoveDirectory"
vRemoveFile fs _ = eh fs "vRemoveFile"
@@ -304,7 +309,11 @@
vGetSymbolicLinkStatus = vGetFileStatus
#endif
+#if MIN_VERSION_directory(1,2,0)
+ vGetModificationTime _ p = getModificationTime p >>= (\modUTCTime -> return $ TOD ((toEnum . fromEnum . utcTimeToPOSIXSeconds) modUTCTime) 0)
+#else
vGetModificationTime _ = getModificationTime
+#endif
#if !(defined(mingw32_HOST_OS) || defined(mingw32_TARGET_OS) || defined(__MINGW32__))
vCreateSymbolicLink _ = createSymbolicLink
vReadSymbolicLink _ = readSymbolicLink
--- MissingH-1.1.1.0-orig/MissingH.cabal 2011-09-07 23:57:11.000000000 +1000
+++ MissingH-1.1.1.0/MissingH.cabal 2012-09-13 00:35:01.354498119 +1000
@@ -94,7 +94,7 @@
hslogger
If flag(splitBase)
Build-Depends: base >= 4, base < 5, directory, random, process, old-time,
- containers, old-locale, array
+ containers, old-locale, array, time
Else
Build-Depends: base < 3
If ! os(windows)
--- MissingH-1.1.1.0-orig/src/System/IO/HVIO.hs 2011-09-07 23:57:11.000000000 +1000
+++ MissingH-1.1.1.0/src/System/IO/HVIO.hs 2012-09-13 00:24:01.570794002 +1000
@@ -121,6 +121,7 @@
import System.IO
import System.IO.Error
+import qualified Control.Exception (catch, IOException)
import Control.Concurrent.MVar
import Data.IORef
import Foreign.Ptr
@@ -287,7 +288,7 @@
x -> accum `seq` loop (accum ++ [x])
handler e = if isEOFError e then return accum
else ioError e
- in catch func handler
+ in Control.Exception.catch func handler
in
do firstchar <- vGetChar h
case firstchar of
@@ -301,7 +302,7 @@
c `seq` return (c : next)
handler e = if isEOFError e then return []
else ioError e
- in catch func handler
+ in Control.Exception.catch func handler
in
do loop
--- MissingH-1.1.1.0-orig/src/Data/Bits/Utils.hs 2011-09-07 23:57:11.000000000 +1000
+++ MissingH-1.1.1.0/src/Data/Bits/Utils.hs 2012-09-13 00:22:07.831925713 +1000
@@ -48,7 +48,7 @@
-}
-fromBytes :: (Bits a) => [a] -> a
+fromBytes :: (Bits a, Num a) => [a] -> a
fromBytes input =
let dofb accum [] = accum
dofb accum (x:xs) = dofb ((shiftL accum 8) .|. x) xs
|