@@ -1,4 +1,3 @@
2{-# LANGUAGE DeriveDataTypeable #-}
1{-# LANGUAGE DeriveDataTypeable #-}
3{-# LANGUAGE GeneralizedNewtypeDeriving #-}
2{-# LANGUAGE GeneralizedNewtypeDeriving #-}
4{-# LANGUAGE NoImplicitPrelude #-}
3{-# LANGUAGE NoImplicitPrelude #-}
@@ -59,45 +58,6 @@ data ParseFailedException = ParseFailedException TypeRep Text
59 deriving (Show, Typeable)
58 deriving (Show, Typeable)
60instance Exception ParseFailedException
59instance Exception ParseFailedException
62−#ifndef MIN_VERSION_streaming_commons
63−#define MIN_VERSION_streaming_commons(x, y, z) 1
65−#if !MIN_VERSION_streaming_commons(0,1,7)
66−data ProcessExitedUnsuccessfully = ProcessExitedUnsuccessfully CreateProcess ExitCode
68−instance Show ProcessExitedUnsuccessfully where
69− show (ProcessExitedUnsuccessfully cp ec) = concat
70− [ "Process exited with "
73− , showCmdSpec (cmdspec cp)
76− showCmdSpec (ShellCommand str) = str
77− showCmdSpec (RawCommand x xs) = unwords (x:xs)
78−instance Exception ProcessExitedUnsuccessfully
80−checkExitCode :: MonadThrow m => CreateProcess -> ExitCode -> m ()
81−checkExitCode _ ExitSuccess = return ()
82−checkExitCode cp ec = throwM $ ProcessExitedUnsuccessfully cp ec
84−-- FIXME move into streaming-commons?
85−withCheckedProcess :: ( InputSource stdin
91− -> (stdin -> stdout -> stderr -> m b)
93−withCheckedProcess cp f = do
94− (x, y, z, sph) <- streamingProcess cp
96− ec <- waitForStreamingProcess sph
97− liftIO $ checkExitCode cp ec
101newtype Maintainer = Maintainer { unMaintainer :: Text }
61newtype Maintainer = Maintainer { unMaintainer :: Text }
102 deriving (Show, Eq, Ord, Hashable, ToJSON, FromJSON, IsString)
62 deriving (Show, Eq, Ord, Hashable, ToJSON, FromJSON, IsString)