[commit: Cabal] master: Make the configure command take the defaults from the config file (7a5ebb1)
Ian Lynagh
igloo at earth.li
Fri Jun 24 01:50:11 CEST 2011
Repository : ssh://darcs.haskell.org//srv/darcs/packages/Cabal
On branch : master
http://hackage.haskell.org/trac/ghc/changeset/7a5ebb14b1a0f6aedd44f51d1ffdfdc1e82ab7a2
>---------------------------------------------------------------
commit 7a5ebb14b1a0f6aedd44f51d1ffdfdc1e82ab7a2
Author: Duncan Coutts <duncan at haskell.org>
Date: Sat Jan 19 17:03:58 2008 +0000
Make the configure command take the defaults from the config file
Just like the install command has always done. This makes them consistent.
So by default that means cabal configure uses --user --prefix=$HOME/.cabal
>---------------------------------------------------------------
cabal-install/Hackage/Setup.hs | 6 ++++++
cabal-install/Main.hs | 15 +++++++++++++--
2 files changed, 19 insertions(+), 2 deletions(-)
diff --git a/cabal-install/Hackage/Setup.hs b/cabal-install/Hackage/Setup.hs
index 8548fde..7d12ddd 100644
--- a/cabal-install/Hackage/Setup.hs
+++ b/cabal-install/Hackage/Setup.hs
@@ -12,6 +12,7 @@
-----------------------------------------------------------------------------
module Hackage.Setup
( globalCommand, Cabal.GlobalFlags(..)
+ , configureCommand
, installCommand --Cabal.InstallFlags(..)
, listCommand
, updateCommand
@@ -61,6 +62,11 @@ globalCommand = Cabal.globalCommand {
++ "\nSee http://www.haskell.org/cabal/ for more information.\n"
}
+configureCommand :: CommandUI Cabal.ConfigFlags
+configureCommand = (Cabal.configureCommand defaultProgramConfiguration) {
+ commandDefaultFlags = mempty
+ }
+
installCommand :: CommandUI Cabal.ConfigFlags
installCommand = (Cabal.configureCommand defaultProgramConfiguration) {
commandName = "install",
diff --git a/cabal-install/Main.hs b/cabal-install/Main.hs
index b123105..5836795 100644
--- a/cabal-install/Main.hs
+++ b/cabal-install/Main.hs
@@ -78,7 +78,8 @@ mainWorker args =
++ " of the Cabal library "
commands =
- [installCommand `commandAddAction` installAction
+ [configureCommand `commandAddAction` configureAction
+ ,installCommand `commandAddAction` installAction
,infoCommand `commandAddAction` infoAction
,listCommand `commandAddAction` listAction
,updateCommand `commandAddAction` updateAction
@@ -86,7 +87,6 @@ mainWorker args =
,fetchCommand `commandAddAction` fetchAction
,uploadCommand `commandAddAction` uploadAction
- ,wrapperAction (Cabal.configureCommand defaultProgramConfiguration)
,wrapperAction (Cabal.buildCommand defaultProgramConfiguration)
,wrapperAction Cabal.copyCommand
,wrapperAction Cabal.haddockCommand
@@ -106,6 +106,17 @@ wrapperAction command =
let args = commandName command : commandShowOptions command flags ++ extraArgs
in setupWrapper args Nothing
+configureAction :: Cabal.ConfigFlags -> [String] -> IO ()
+configureAction flags extraArgs = do
+ configFile <- defaultConfigFile --FIXME
+ let verbosity = fromFlagOrDefault normal (Cabal.configVerbose flags)
+ config <- loadConfig verbosity configFile
+ let flags' = savedConfigToConfigFlags (Cabal.configPackageDB flags) config
+ `mappend` flags
+ args = commandName configureCommand
+ : commandShowOptions configureCommand flags' ++ extraArgs
+ setupWrapper args Nothing
+
installAction :: Cabal.ConfigFlags -> [String] -> IO ()
installAction flags extraArgs = do
pkgs <- either die return (parsePackageArgs extraArgs)
More information about the Cvs-libraries
mailing list