Commit af5d1345 authored by Mikhail Glushenkov's avatar Mikhail Glushenkov
Browse files

Rename 'Distribution.Compat.*' to 'Distribution.Client.Compat.*'.

Helps to disambiguate Cabal's compat modules from cabal-install's.
parent 1b431a7f
......@@ -2,7 +2,7 @@
-----------------------------------------------------------------------------
-- |
-- Module : Distribution.Compat.Env
-- Module : Distribution.Client.Compat.Environment
-- Copyright : (c) Simon Hengel 2012
-- License : BSD-style (see the file LICENSE)
--
......@@ -14,7 +14,7 @@
--
-----------------------------------------------------------------------------
module Distribution.Compat.Env (
module Distribution.Client.Compat.Environment (
lookupEnv, setEnv
) where
......@@ -33,7 +33,7 @@ import Foreign.C.Error (throwErrnoIfMinus1_)
import System.Environment (lookupEnv)
#else
import System.Environment (getEnv)
import Distribution.Compat.Exception (catchIO)
import Distribution.Client.Compat.Exception (catchIO)
#endif
import System.Posix.Internals ( withFilePath )
......
{-# LANGUAGE CPP #-}
{-# OPTIONS_HADDOCK hide #-}
module Distribution.Compat.Exception (
module Distribution.Client.Compat.Exception (
mask,
mask_,
catchIO,
......
{-# LANGUAGE CPP #-}
{-# OPTIONS_HADDOCK hide #-}
module Distribution.Compat.FilePerms (
module Distribution.Client.Compat.FilePerms (
setFileOrdinary,
setFileExecutable,
setFileHidden,
......
{-# LANGUAGE DeriveDataTypeable #-}
{-# OPTIONS_GHC -funbox-strict-fields #-}
module Distribution.Compat.Semaphore
module Distribution.Client.Compat.Semaphore
( QSem
, newQSem
, waitQSem
......@@ -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
......
{-# LANGUAGE CPP, ForeignFunctionInterface #-}
module Distribution.Compat.Time (EpochTime, getModTime, getFileAge, getCurTime)
module Distribution.Client.Compat.Time
(EpochTime, getModTime, getFileAge, getCurTime)
where
import Data.Int (Int64)
......@@ -65,7 +66,7 @@ getModTime path = withCString path $ \file ->
if not res
then do
let err = mkIOError doesNotExistErrorType
"Distribution.Compat.Time.getModTime"
"Distribution.Client.Compat.Time.getModTime"
Nothing (Just path)
ioError err
else do
......
......@@ -104,7 +104,7 @@ import System.Environment
( getEnvironment )
import System.IO.Error
( isDoesNotExistError )
import Distribution.Compat.Exception
import Distribution.Client.Compat.Exception
( catchIO )
--
......
......@@ -70,16 +70,17 @@ import qualified Data.ByteString.Char8 as BSS
import Data.ByteString.Lazy (ByteString)
import Distribution.Client.GZipUtils (maybeDecompress)
import Distribution.Client.Utils (byteStringToFilePath)
import Distribution.Client.Compat.Exception (catchIO)
import Distribution.Client.Compat.Time
import System.FilePath ((</>), takeExtension, splitDirectories, normalise)
import System.FilePath.Posix as FilePath.Posix
( takeFileName )
import System.IO
import System.IO.Unsafe (unsafeInterleaveIO)
import System.IO.Error (isDoesNotExistError)
import Distribution.Compat.Exception (catchIO)
import System.Directory
( getModificationTime, doesFileExist )
import Distribution.Compat.Time
getInstalledPackages :: Verbosity -> Compiler
......
......@@ -37,7 +37,7 @@ import Control.Exception as Exception
, IOException, SomeException )
import System.Exit
( ExitCode )
import Distribution.Compat.Exception
import Distribution.Client.Compat.Exception
( catchIO, catchExit )
import Control.Monad
( when, unless )
......
......@@ -65,7 +65,7 @@ import System.FilePath
import Prelude hiding (ioError)
import System.IO.Error
( isDoesNotExistError, ioError )
import Distribution.Compat.Exception ( catchIO )
import Distribution.Client.Compat.Exception ( catchIO )
import Control.Exception
( assert )
import Data.Maybe
......
......@@ -29,8 +29,8 @@ 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.Compat.Semaphore
import Distribution.Client.Compat.Exception (mask)
import Distribution.Client.Compat.Semaphore
data JobControl m a = JobControl {
spawnJob :: m a -> m (),
......
......@@ -86,8 +86,8 @@ import Distribution.Package ( Package(..) )
import Distribution.System ( Platform )
import Distribution.Text ( display )
import Distribution.Verbosity ( Verbosity, lessVerbose )
import Distribution.Compat.Env ( lookupEnv, setEnv )
import Distribution.Compat.FilePerms ( setFileHidden )
import Distribution.Client.Compat.Environment ( lookupEnv, setEnv )
import Distribution.Client.Compat.FilePerms ( setFileHidden )
import qualified Distribution.Client.Sandbox.Index as Index
import qualified Distribution.Simple.PackageIndex as InstalledPackageIndex
import qualified Distribution.Simple.Register as Register
......
......@@ -53,7 +53,8 @@ import Distribution.Verbosity ( Verbosity, normal )
import Control.Monad ( foldM, when, unless )
import Data.List ( partition )
import Data.Monoid ( Monoid(..) )
import Distribution.Compat.Exception ( catchIO )
import Distribution.Client.Compat.Exception
( catchIO )
import System.Directory ( doesDirectoryExist, doesFileExist,
renameFile )
import System.FilePath ( (<.>), (</>), takeDirectory )
......
......@@ -50,8 +50,8 @@ import Distribution.Client.SetupWrapper (SetupScriptOptions (..),
import Distribution.Client.Utils (inDir, removeExistingFile,
tryCanonicalizePath)
import Distribution.Compat.Exception (catchIO)
import Distribution.Compat.Time (EpochTime, getCurTime,
import Distribution.Client.Compat.Exception (catchIO)
import Distribution.Client.Compat.Time (EpochTime, getCurTime,
getModTime)
......
......@@ -78,7 +78,7 @@ import Distribution.Text
( display )
import Distribution.Verbosity
( Verbosity )
import Distribution.Compat.Exception
import Distribution.Client.Compat.Exception
( catchIO )
import System.Directory ( doesFileExist )
......
......@@ -89,11 +89,11 @@ import System.Directory
, getPermissions, createDirectoryIfMissing, copyFile )
import qualified System.Directory as Permissions
( Permissions(executable) )
import Distribution.Compat.FilePerms
import Distribution.Client.Compat.FilePerms
( setFileExecutable )
import System.Posix.Types
( FileMode )
import Distribution.Compat.Time
import Distribution.Client.Compat.Time
import System.IO
( IOMode(ReadMode), openBinaryFile, hFileSize )
import System.IO.Unsafe (unsafeInterleaveIO)
......
......@@ -9,7 +9,7 @@ module Distribution.Client.Utils ( MergeResult(..)
, canonicalizePathNoThrow )
where
import Distribution.Compat.Exception ( catchIO )
import Distribution.Client.Compat.Exception ( catchIO )
import qualified Data.ByteString.Lazy as BS
import Control.Monad
( when )
......
......@@ -40,7 +40,7 @@ import Distribution.Simple.Utils
import Distribution.Text
( Text(..), display, simpleParse )
import qualified Distribution.Compat.ReadP as Parse
import Distribution.Compat.Exception ( catchIO )
import Distribution.Client.Compat.Exception ( catchIO )
import qualified Text.PrettyPrint as Disp
import Text.PrettyPrint ( (<>), (<+>) )
......
......@@ -105,11 +105,11 @@ executable cabal
Distribution.Client.Utils
Distribution.Client.World
Distribution.Client.Win32SelfUpgrade
Distribution.Compat.Exception
Distribution.Compat.Env
Distribution.Compat.FilePerms
Distribution.Compat.Semaphore
Distribution.Compat.Time
Distribution.Client.Compat.Exception
Distribution.Client.Compat.Environment
Distribution.Client.Compat.FilePerms
Distribution.Client.Compat.Semaphore
Distribution.Client.Compat.Time
Paths_cabal_install
build-depends:
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment