......@@ -40,10 +40,12 @@ import Data.Maybe
import Data.Function
( on )
import qualified Data.Map as M
#if !MIN_VERSION_base(4,8,0)
import Data.Traversable
( traverse )
import Control.Applicative
( (<$>) )
#endif
import Control.Monad
( when, unless, (>=>), join, forM_ )
import Control.Arrow
......
{-# LANGUAGE CPP #-}
-----------------------------------------------------------------------------
-- |
-- Module : Distribution.Client.Init.Heuristics
......@@ -35,14 +36,18 @@ import Distribution.Client.Utils
import Language.Haskell.Extension ( Extension )
import Distribution.Client.Types ( packageDescription, SourcePackageDb(..) )
#if !MIN_VERSION_base(4,8,0)
import Control.Applicative ( pure, (<$>), (<*>) )
#endif
import Control.Arrow ( first )
import Control.Monad ( liftM )
import Data.Char ( isAlphaNum, isNumber, isUpper, isLower, isSpace )
import Data.Either ( partitionEithers )
import Data.List ( isInfixOf, isPrefixOf, isSuffixOf, sortBy )
import Data.Maybe ( mapMaybe, catMaybes, maybeToList )
#if !MIN_VERSION_base(4,8,0)
import Data.Monoid ( mempty, mappend, mconcat, )
#endif
import Data.Ord ( comparing )
import qualified Data.Set as Set ( fromList, toList )
import System.Directory ( getCurrentDirectory, getDirectoryContents,
......
{-# LANGUAGE CPP #-}
-----------------------------------------------------------------------------
-- |
-- Module : Distribution.Client.Init.Types
......@@ -27,7 +28,9 @@ import qualified Text.PrettyPrint as Disp
import qualified Distribution.Compat.ReadP as Parse
import Distribution.Text
#if !MIN_VERSION_base(4,8,0)
import Data.Monoid
#endif
-- | InitFlags is really just a simple type to represent certain
-- portions of a .cabal file. Rather than have a flag for EVERY
......
......@@ -45,8 +45,10 @@ import System.Exit
( ExitCode(..) )
import Distribution.Compat.Exception
( catchIO, catchExit )
#if !MIN_VERSION_base(4,8,0)
import Control.Applicative
( (<$>) )
#endif
import Control.Monad
( forM_, when, unless )
import System.Directory
......
{-# LANGUAGE CPP #-}
{-# LANGUAGE DeriveFunctor #-}
-----------------------------------------------------------------------------
-- |
......@@ -63,7 +64,9 @@ import qualified Data.Graph as Graph
import qualified Data.Array as Array
import Data.Array ((!))
import Data.List (groupBy, sortBy, nub, isInfixOf)
#if !MIN_VERSION_base(4,8,0)
import Data.Monoid (Monoid(..))
#endif
import Data.Maybe (isJust, isNothing, fromMaybe, catMaybes)
import Distribution.Package
......
{-# LANGUAGE CPP #-}
-----------------------------------------------------------------------------
-- |
-- Module : Distribution.Client.Run
......@@ -28,7 +29,9 @@ import Distribution.Verbosity (Verbosity)
import qualified Distribution.Simple.GHCJS as GHCJS
#if !MIN_VERSION_base(4,8,0)
import Data.Functor ((<$>))
#endif
import Data.List (find)
import System.Directory (getCurrentDirectory)
import Distribution.Compat.Environment (getEnvironment)
......
{-# LANGUAGE CPP #-}
-----------------------------------------------------------------------------
-- |
-- Module : Distribution.Client.Sandbox
......@@ -104,7 +105,9 @@ import Data.Char ( ord )
import Data.IORef ( newIORef, writeIORef, readIORef )
import Data.List ( delete, foldl' )
import Data.Maybe ( fromJust, fromMaybe )
#if !MIN_VERSION_base(4,8,0)
import Data.Monoid ( mempty, mappend )
#endif
import Data.Word ( Word32 )
import Numeric ( showHex )
import System.Directory ( createDirectory
......@@ -595,10 +598,10 @@ reinstallAddSourceDeps verbosity configFlags' configExFlags
die' message = die (message ++ installFailedInSandbox)
-- TODO: use a better error message, remove duplication.
installFailedInSandbox =
"Note: when using a sandbox, all packages are required to have \
\consistent dependencies. \
\Try reinstalling/unregistering the offending packages or \
\recreating the sandbox."
"Note: when using a sandbox, all packages are required to have "
++ "consistent dependencies. "
++ "Try reinstalling/unregistering the offending packages or "
++ "recreating the sandbox."
logMsg message rest = debugNoWrap verbosity message >> rest
topHandler' = topHandlerWith $ \_ -> do
......
{-# LANGUAGE CPP #-}
-----------------------------------------------------------------------------
-- |
-- Module : Distribution.Client.Sandbox.PackageEnvironment
......@@ -60,7 +61,9 @@ import Distribution.Verbosity ( Verbosity, normal )
import Control.Monad ( foldM, liftM2, when, unless )
import Data.List ( partition )
import Data.Maybe ( isJust )
#if !MIN_VERSION_base(4,8,0)
import Data.Monoid ( Monoid(..) )
#endif
import Distribution.Compat.Exception ( catchIO )
import System.Directory ( doesDirectoryExist, doesFileExist
, renameFile )
......
{-# LANGUAGE CPP #-}
-----------------------------------------------------------------------------
-- |
-- Module : Distribution.Client.Sandbox.Types
......@@ -15,7 +16,9 @@ module Distribution.Client.Sandbox.Types (
import qualified Distribution.Simple.PackageIndex as InstalledPackageIndex
import Distribution.Client.Types (SourcePackage)
#if !MIN_VERSION_base(4,8,0)
import Data.Monoid
#endif
import qualified Data.Set as S
-- | Are we using a sandbox?
......
{-# LANGUAGE CPP #-}
-----------------------------------------------------------------------------
-- |
-- Module : Distribution.Client.Setup
......@@ -92,11 +93,13 @@ import Distribution.Simple.Utils
import Data.Char
( isSpace, isAlphaNum )
import Data.List
( intercalate, deleteFirstsBy )
( intercalate, delete, deleteFirstsBy )
import Data.Maybe
( listToMaybe, maybeToList, fromMaybe )
#if !MIN_VERSION_base(4,8,0)
import Data.Monoid
( Monoid(..) )
#endif
import Control.Monad
( liftM )
import System.FilePath
......@@ -271,8 +274,7 @@ globalCommand commands = CommandUI {
(reqArgFlag "FILE")
,option [] ["sandbox-config-file"]
"Set an alternate location for the sandbox config file \
\(default: './cabal.sandbox.config')"
"Set an alternate location for the sandbox config file (default: './cabal.sandbox.config')"
globalConfigFile (\v flags -> flags { globalSandboxConfigFile = v })
(reqArgFlag "FILE")
......@@ -368,7 +370,8 @@ configureOptions = commandOptions configureCommand
filterConfigureFlags :: ConfigFlags -> Version -> ConfigFlags
filterConfigureFlags flags cabalLibVersion
| cabalLibVersion >= Version [1,19,2] [] = flags_latest
| cabalLibVersion >= Version [1,21,1] [] = flags_latest
-- ^ NB: we expect the latest version to be the most common case.
| cabalLibVersion < Version [1,3,10] [] = flags_1_3_10
| cabalLibVersion < Version [1,10,0] [] = flags_1_10_0
| cabalLibVersion < Version [1,14,0] [] = flags_1_14_0
......@@ -389,6 +392,9 @@ filterConfigureFlags flags cabalLibVersion
, configProfLib = configProfLib flags
, configCoverage = NoFlag
, configLibCoverage = configCoverage flags
-- HACK: See #2409.
, configProgramPaths =
("cabalConfProf", "/TRUE") `delete` configProgramPaths flags
}
-- Cabal < 1.19.2 doesn't know about '--exact-configuration'.
flags_1_19_1 = flags_1_20_0 { configExactConfiguration = NoFlag }
......
......@@ -97,11 +97,15 @@ import System.FilePath ( (</>), (<.>) )
import System.IO ( Handle, hPutStr )
import System.Exit ( ExitCode(..), exitWith )
import System.Process ( runProcess, waitForProcess )
#if !MIN_VERSION_base(4,8,0)
import Control.Applicative ( (<$>), (<*>) )
#endif
import Control.Monad ( when, unless )
import Data.List ( foldl1' )
import Data.Maybe ( fromMaybe, isJust )
#if !MIN_VERSION_base(4,8,0)
import Data.Monoid ( mempty )
#endif
import Data.Char ( isSpace )
#ifdef mingw32_HOST_OS
......
{-# LANGUAGE CPP #-}
-----------------------------------------------------------------------------
-- |
-- Module : Distribution.Client.Targets
......@@ -79,8 +80,10 @@ import Data.Maybe
( listToMaybe )
import Data.Either
( partitionEithers )
#if !MIN_VERSION_base(4,8,0)
import Data.Monoid
( Monoid(..) )
#endif
import qualified Data.Map as Map
import qualified Data.ByteString.Lazy as BS
import qualified Data.ByteString.Lazy.Char8 as BS.Char8
......
......@@ -154,7 +154,9 @@ import System.IO ( BufferMode(LineBuffering), hSetBuffering
import System.Directory (doesFileExist, getCurrentDirectory)
import Data.List (intercalate)
import Data.Maybe (mapMaybe)
#if !MIN_VERSION_base(4,8,0)
import Data.Monoid (Monoid(..))
#endif
import Control.Monad (when, unless)
-- | Entry point
......
Name: cabal-install
Version: 1.22.0.1
Version: 1.22.2.0
Synopsis: The command-line interface for Cabal and Hackage.
Description:
The \'cabal\' command-line program simplifies the process of managing
......@@ -129,7 +129,7 @@ executable cabal
array >= 0.1 && < 0.6,
base >= 4.3 && < 5,
bytestring >= 0.9 && < 1,
Cabal >= 1.22 && < 1.23,
Cabal >= 1.22.2 && < 1.23,
containers >= 0.1 && < 0.6,
filepath >= 1.0 && < 1.5,
HTTP >= 4000.2.5 && < 4000.3,
......
{-# LANGUAGE CPP #-}
module PackageTests.Exec.Check
( tests
) where
......@@ -9,7 +10,9 @@ import Test.Framework as TF (Test)
import Test.Framework.Providers.HUnit (testCase)
import Test.HUnit (assertBool)
#if !MIN_VERSION_base(4,8,0)
import Control.Applicative ((<$>))
#endif
import Control.Monad (when)
import Data.List (intercalate, isInfixOf)
import System.FilePath ((</>))
......
{-# LANGUAGE CPP #-}
module UnitTests.Distribution.Client.UserConfig
( tests
) where
import Control.Exception (bracket)
import Data.List (sort, nub)
#if !MIN_VERSION_base(4,8,0)
import Data.Monoid
#endif
import System.Directory (getCurrentDirectory, removeDirectoryRecursive, createDirectoryIfMissing)
import System.FilePath (takeDirectory)
......