[commit: Cabal] master: changed --override-reinstall-check to --force-reinstalls (10098d3)
Ian Lynagh
igloo at earth.li
Fri Nov 11 22:51:16 CET 2011
Repository : ssh://darcs.haskell.org//srv/darcs/packages/Cabal
On branch : master
http://hackage.haskell.org/trac/ghc/changeset/10098d3709e9febe14675f5eeaa6a4f4a42bd4c1
>---------------------------------------------------------------
commit 10098d3709e9febe14675f5eeaa6a4f4a42bd4c1
Author: Andres Loeh <andres at well-typed.com>
Date: Mon Nov 7 15:07:13 2011 +0000
changed --override-reinstall-check to --force-reinstalls
Also adapted the message for the failed check.
>---------------------------------------------------------------
cabal-install/Distribution/Client/Install.hs | 24 +++++++++++++++++-------
cabal-install/Distribution/Client/Setup.hs | 6 +-----
2 files changed, 18 insertions(+), 12 deletions(-)
diff --git a/cabal-install/Distribution/Client/Install.hs b/cabal-install/Distribution/Client/Install.hs
index e8eee2b..0edb4b0 100644
--- a/cabal-install/Distribution/Client/Install.hs
+++ b/cabal-install/Distribution/Client/Install.hs
@@ -48,6 +48,8 @@ import System.IO.Error
import Distribution.Client.Targets
import Distribution.Client.Dependency
+import Distribution.Client.Dependency.Types
+ ( Solver(..) )
import Distribution.Client.FetchUtils
import qualified Distribution.Client.Haddock as Haddock (regenerateHaddockIndex)
-- import qualified Distribution.Client.Info as Info
@@ -172,7 +174,7 @@ install verbosity packageDBs repos comp conf
comp configFlags configExFlags installFlags
installedPkgIndex sourcePkgDb pkgSpecifiers
- checkPrintPlan verbosity installedPkgIndex installPlan installFlags
+ checkPrintPlan verbosity installedPkgIndex installPlan installFlags solver
unless dryRun $ do
installPlan' <- performInstallations verbosity
@@ -185,6 +187,7 @@ install verbosity packageDBs repos comp conf
globalFlags, configFlags, configExFlags, installFlags, haddockFlags)
dryRun = fromFlag (installDryRun installFlags)
+ solver = fromFlag (configSolver configExFlags)
logMsg message rest = debug verbosity message >> rest
@@ -338,8 +341,9 @@ checkPrintPlan :: Verbosity
-> PackageIndex
-> InstallPlan
-> InstallFlags
+ -> Solver
-> IO ()
-checkPrintPlan verbosity installed installPlan installFlags = do
+checkPrintPlan verbosity installed installPlan installFlags solver = do
when nothingToInstall $
notice verbosity $
@@ -358,11 +362,17 @@ checkPrintPlan verbosity installed installPlan installFlags = do
when (containsReinstalls && not overrideReinstall) $
(if dryRun then notice adaptedVerbosity else die) $
"The install plan contains reinstalls which can break "
- ++ "your GHC installation.\nYou can use the --avoid-reinstalls option "
- ++ "to try to avoid this or try\nto ghc-pkg unregister the version of "
- ++ "the package version to see its effect\non reverse dependencies. "
- ++ "If you know what you are doing you can use\nthe "
- ++ "--override-reinstall-check option to override this reinstall check."
+ ++ "your GHC installation. "
+ ++ (if solver /= Modular
+ then "You can try --solver=modular for the new modular solver that "
+ ++ "chooses such reinstalls less often and also offers the "
+ ++ "--avoid-reinstalls option. "
+ else "You can use the --avoid-reinstalls option to try to find an "
+ ++ "install plan without such reinstalls. ")
+ ++ "You can also ghc-pkg unregister the affected packages and run "
+ ++ "ghc-pkg check to see the effect on reverse dependencies. "
+ ++ "If you know what you are doing you can use the "
+ ++ "--force-reinstalls option to override this reinstall check."
where
nothingToInstall = null (InstallPlan.ready installPlan)
diff --git a/cabal-install/Distribution/Client/Setup.hs b/cabal-install/Distribution/Client/Setup.hs
index aaa99ca..bcb8cff 100644
--- a/cabal-install/Distribution/Client/Setup.hs
+++ b/cabal-install/Distribution/Client/Setup.hs
@@ -596,7 +596,6 @@ data InstallFlags = InstallFlags {
installDocumentation :: Flag Bool,
installHaddockIndex :: Flag PathTemplate,
installDryRun :: Flag Bool,
- installSolver :: Flag Solver,
installMaxBackjumps :: Flag Int,
installReorderGoals :: Flag Bool,
installIndependentGoals :: Flag Bool,
@@ -619,7 +618,6 @@ defaultInstallFlags = InstallFlags {
installDocumentation = Flag False,
installHaddockIndex = Flag docIndexFile,
installDryRun = Flag False,
- installSolver = Flag defaultSolver,
installMaxBackjumps = Flag defaultMaxBackjumps,
installReorderGoals = Flag False,
installIndependentGoals= Flag False,
@@ -732,7 +730,7 @@ installOptions showOrParseArgs =
installAvoidReinstalls (\v flags -> flags { installAvoidReinstalls = v })
trueArg
- , option [] ["override-reinstall-check"]
+ , option [] ["force-reinstalls"]
"Use to override the check that prevents reinstalling already installed versions of package dependencies."
installOverrideReinstall (\v flags -> flags { installOverrideReinstall = v })
trueArg
@@ -795,7 +793,6 @@ instance Monoid InstallFlags where
installDocumentation = mempty,
installHaddockIndex = mempty,
installDryRun = mempty,
- installSolver = mempty,
installReinstall = mempty,
installAvoidReinstalls = mempty,
installOverrideReinstall = mempty,
@@ -816,7 +813,6 @@ instance Monoid InstallFlags where
installDocumentation = combine installDocumentation,
installHaddockIndex = combine installHaddockIndex,
installDryRun = combine installDryRun,
- installSolver = combine installSolver,
installReinstall = combine installReinstall,
installAvoidReinstalls = combine installAvoidReinstalls,
installOverrideReinstall = combine installOverrideReinstall,
More information about the Cvs-libraries
mailing list