--- src/IPatch/Common.hs.orig 2014-01-25 15:50:41.000000000 +0100
+++ src/IPatch/Common.hs 2014-01-25 16:17:01.000000000 +0100
- the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
- Boston, MA 02110-1301, USA.
-{-# LANGUAGE Rank2Types, ScopedTypeVariables, TypeFamilies, GADTs #-}
+{-# LANGUAGE Rank2Types, ScopedTypeVariables, TypeFamilies, GADTs, ScopedTypeVariables #-}
module IPatch.Common where
import Control.Applicative ( (<$>) )
import Control.Monad ( when, unless )
+import Control.Exception ( catch, IOException )
import System.Posix.Files ( getSymbolicLinkStatus, isRegularFile, isDirectory )
import System.Directory ( createDirectoryIfMissing, doesFileExist, removeFile )
import System.FilePath.Posix ( (</>), takeDirectory, normalise )
exT <- doesFileExist dest'
when exT $ removeFile dest'
- `catch` fail ("clonePathWithDeletion: Bad file " ++ source </> path)
+ `catch` (\(_ :: IOException) -> fail ("clonePathWithDeletion: Bad file " ++ source </> path))
clonePathsWithDeletion source dest = mapM_ (clonePathWithDeletion source dest)
-- Now we obliterate the patch, undoing its effects
- applyToWorking repo [] (invert patch_ps) `catch` \e ->
- fail ("Couldn't undo diff effect in working dir.\n" ++ show e)
+ applyToWorking repo [] (invert patch_ps) `catch` (\(e :: IOException) ->
+ fail ("Couldn't undo diff effect in working dir.\n" ++ show e))
--- src/IPatch/Apply.hs.orig 2014-01-25 16:16:07.000000000 +0100
+++ src/IPatch/Apply.hs 2014-01-25 16:16:40.000000000 +0100
module IPatch.Apply where
import Control.Monad ( when )
+import Control.Exception ( catch, IOException )
import System.Exit ( exitWith, ExitCode(ExitSuccess) )
debugMessage $ "Applying selected patches"
- applyToWorking repo opts wanted_ps `catch` \e ->
- fail ("Error applying patch to working dir:\n" ++ show e)
+ applyToWorking repo opts wanted_ps `catch` (\(e :: IOException) ->
+ fail ("Error applying patch to working dir:\n" ++ show e))
yorn <- promptYorn "Really apply the selected changes?"