@@ -1,4 +1,3 @@
1−{-# LANGUAGE CPP #-}
21{-# LANGUAGE DeriveDataTypeable #-}
32{-# LANGUAGE GeneralizedNewtypeDeriving #-}
43{-# LANGUAGE NoImplicitPrelude #-}
@@ -59,45 +58,6 @@ data ParseFailedException = ParseFailedException TypeRep Text
5958 deriving (Show, Typeable)
6059instance Exception ParseFailedException
6160
62−#ifndef MIN_VERSION_streaming_commons
63−#define MIN_VERSION_streaming_commons(x, y, z) 1
64−#endif
65−#if !MIN_VERSION_streaming_commons(0,1,7)
66−data ProcessExitedUnsuccessfully = ProcessExitedUnsuccessfully CreateProcess ExitCode
67− deriving Typeable
68−instance Show ProcessExitedUnsuccessfully where
69− show (ProcessExitedUnsuccessfully cp ec) = concat
70− [ "Process exited with "
71− , show ec
72− , ": "
73− , showCmdSpec (cmdspec cp)
74− ]
75− where
76− showCmdSpec (ShellCommand str) = str
77− showCmdSpec (RawCommand x xs) = unwords (x:xs)
78−instance Exception ProcessExitedUnsuccessfully
79−
80−checkExitCode :: MonadThrow m => CreateProcess -> ExitCode -> m ()
81−checkExitCode _ ExitSuccess = return ()
82−checkExitCode cp ec = throwM $ ProcessExitedUnsuccessfully cp ec
83−
84−-- FIXME move into streaming-commons?
85−withCheckedProcess :: ( InputSource stdin
86− , OutputSink stderr
87− , OutputSink stdout
88− , MonadIO m
89− )
90− => CreateProcess
91− -> (stdin -> stdout -> stderr -> m b)
92− -> m b
93−withCheckedProcess cp f = do
94− (x, y, z, sph) <- streamingProcess cp
95− res <- f x y z
96− ec <- waitForStreamingProcess sph
97− liftIO $ checkExitCode cp ec
98− return res
99−#endif
100−
10161newtype Maintainer = Maintainer { unMaintainer :: Text }
10262 deriving (Show, Eq, Ord, Hashable, ToJSON, FromJSON, IsString)
10363