[commit: packages/Cabal] ghc-head: Move 'mask' and 'mask_' back to D.Client.Compat.Exception. (9acc6e2)
git at git.haskell.org
git at git.haskell.org
Mon Aug 26 23:30:39 CEST 2013
Repository : ssh://git@git.haskell.org/Cabal
On branch : ghc-head
Link : http://git.haskell.org/?p=packages/Cabal.git;a=commit;h=9acc6e2f92e4d5141c9958dd8a2b2931a7a7447a
>---------------------------------------------------------------
commit 9acc6e2f92e4d5141c9958dd8a2b2931a7a7447a
Author: Mikhail Glushenkov <mikhail.glushenkov at gmail.com>
Date: Fri Aug 23 09:29:27 2013 +0200
Move 'mask' and 'mask_' back to D.Client.Compat.Exception.
The MIN_VERSION_base used in this module broke bootstrapping.
>---------------------------------------------------------------
9acc6e2f92e4d5141c9958dd8a2b2931a7a7447a
Cabal/Distribution/Compat/Exception.hs | 21 --------------------
.../Distribution/Client}/Compat/Exception.hs | 19 ++----------------
.../Distribution/Client/Compat/Semaphore.hs | 2 +-
cabal-install/Distribution/Client/JobControl.hs | 2 +-
cabal-install/cabal-install.cabal | 1 +
5 files changed, 5 insertions(+), 40 deletions(-)
diff --git a/Cabal/Distribution/Compat/Exception.hs b/Cabal/Distribution/Compat/Exception.hs
index a1e3eeb..453d8b0 100644
--- a/Cabal/Distribution/Compat/Exception.hs
+++ b/Cabal/Distribution/Compat/Exception.hs
@@ -1,7 +1,4 @@
-{-# LANGUAGE CPP #-}
module Distribution.Compat.Exception (
- mask,
- mask_,
catchIO,
catchExit,
tryIO,
@@ -10,24 +7,6 @@ module Distribution.Compat.Exception (
import System.Exit
import qualified Control.Exception as Exception
-#if MIN_VERSION_base(4,3,0)
--- it's much less of a headache if we re-export the "real" mask and mask_
--- so there's never more than one definition to conflict
-import Control.Exception (mask, mask_)
-#else
-import Control.Exception (block, unblock)
-#endif
-
-#if !MIN_VERSION_base(4,3,0)
--- note: less polymorphic than 'real' mask, to avoid RankNTypes
--- we don't need the full generality where we use it
-mask :: ((IO a -> IO a) -> IO b) -> IO b
-mask handler = block (handler unblock)
-
-mask_ :: IO a -> IO a
-mask_ = block
-#endif
-
tryIO :: IO a -> IO (Either Exception.IOException a)
tryIO = Exception.try
diff --git a/Cabal/Distribution/Compat/Exception.hs b/cabal-install/Distribution/Client/Compat/Exception.hs
similarity index 59%
copy from Cabal/Distribution/Compat/Exception.hs
copy to cabal-install/Distribution/Client/Compat/Exception.hs
index a1e3eeb..a7a5b84 100644
--- a/Cabal/Distribution/Compat/Exception.hs
+++ b/cabal-install/Distribution/Client/Compat/Exception.hs
@@ -1,15 +1,9 @@
{-# LANGUAGE CPP #-}
-module Distribution.Compat.Exception (
+module Distribution.Client.Compat.Exception (
mask,
- mask_,
- catchIO,
- catchExit,
- tryIO,
+ mask_
) where
-import System.Exit
-import qualified Control.Exception as Exception
-
#if MIN_VERSION_base(4,3,0)
-- it's much less of a headache if we re-export the "real" mask and mask_
-- so there's never more than one definition to conflict
@@ -27,12 +21,3 @@ mask handler = block (handler unblock)
mask_ :: IO a -> IO a
mask_ = block
#endif
-
-tryIO :: IO a -> IO (Either Exception.IOException a)
-tryIO = Exception.try
-
-catchIO :: IO a -> (Exception.IOException -> IO a) -> IO a
-catchIO = Exception.catch
-
-catchExit :: IO a -> (ExitCode -> IO a) -> IO a
-catchExit = Exception.catch
diff --git a/cabal-install/Distribution/Client/Compat/Semaphore.hs b/cabal-install/Distribution/Client/Compat/Semaphore.hs
index 274cc2e..71e4c81 100644
--- a/cabal-install/Distribution/Client/Compat/Semaphore.hs
+++ b/cabal-install/Distribution/Client/Compat/Semaphore.hs
@@ -13,7 +13,7 @@ import Control.Exception (onException)
import Control.Monad (join, when)
import Data.Typeable (Typeable)
-import Distribution.Compat.Exception (mask_)
+import Distribution.Client.Compat.Exception (mask_)
-- | 'QSem' is a quantity semaphore in which the resource is aqcuired
-- and released in units of one. It provides guaranteed FIFO ordering
diff --git a/cabal-install/Distribution/Client/JobControl.hs b/cabal-install/Distribution/Client/JobControl.hs
index 326f8e0..4f8229c 100644
--- a/cabal-install/Distribution/Client/JobControl.hs
+++ b/cabal-install/Distribution/Client/JobControl.hs
@@ -29,7 +29,7 @@ module Distribution.Client.JobControl (
import Control.Monad
import Control.Concurrent hiding (QSem, newQSem, waitQSem, signalQSem)
import Control.Exception (SomeException, bracket_, throw, try)
-import Distribution.Compat.Exception (mask)
+import Distribution.Client.Compat.Exception (mask)
import Distribution.Client.Compat.Semaphore
data JobControl m a = JobControl {
diff --git a/cabal-install/cabal-install.cabal b/cabal-install/cabal-install.cabal
index 5a170f1..e172475 100644
--- a/cabal-install/cabal-install.cabal
+++ b/cabal-install/cabal-install.cabal
@@ -106,6 +106,7 @@ executable cabal
Distribution.Client.World
Distribution.Client.Win32SelfUpgrade
Distribution.Client.Compat.Environment
+ Distribution.Client.Compat.Exception
Distribution.Client.Compat.FilePerms
Distribution.Client.Compat.Semaphore
Distribution.Client.Compat.Time
More information about the ghc-commits
mailing list