[commit: Cabal] master: Simplify the way we derive configure, install and upgrade commands (a4e4634)
Paolo Capriotti
p.capriotti at gmail.com
Tue May 8 00:01:16 CEST 2012
Repository : ssh://darcs.haskell.org//srv/darcs/packages/Cabal
On branch : master
http://hackage.haskell.org/trac/ghc/changeset/a4e46349f9703147c344a8f7465e2ad419b3962c
>---------------------------------------------------------------
commit a4e46349f9703147c344a8f7465e2ad419b3962c
Author: Duncan Coutts <duncan at haskell.org>
Date: Wed Apr 30 08:52:01 2008 +0000
Simplify the way we derive configure, install and upgrade commands
so we do not accidentally inherit the default flags for the underlying
configure command when we in fact want the empty flags. I am beginning
to suspect that having any defaults at all was a mistake.
>---------------------------------------------------------------
cabal-install/Hackage/Setup.hs | 13 +++++--------
1 files changed, 5 insertions(+), 8 deletions(-)
diff --git a/cabal-install/Hackage/Setup.hs b/cabal-install/Hackage/Setup.hs
index 918bdc7..b51cdd9 100644
--- a/cabal-install/Hackage/Setup.hs
+++ b/cabal-install/Hackage/Setup.hs
@@ -62,11 +62,8 @@ globalCommand = Cabal.globalCommand {
++ "\nSee http://www.haskell.org/cabal/ for more information.\n"
}
-cabalConfigureCommand :: CommandUI Cabal.ConfigFlags
-cabalConfigureCommand = Cabal.configureCommand defaultProgramConfiguration
-
configureCommand :: CommandUI Cabal.ConfigFlags
-configureCommand = cabalConfigureCommand {
+configureCommand = (Cabal.configureCommand defaultProgramConfiguration) {
commandDefaultFlags = mempty
}
@@ -91,14 +88,14 @@ updateCommand = CommandUI {
}
upgradeCommand :: CommandUI (Cabal.ConfigFlags, InstallFlags)
-upgradeCommand = cabalConfigureCommand {
+upgradeCommand = configureCommand {
commandName = "upgrade",
commandSynopsis = "Upgrades installed packages to the latest available version",
commandDescription = Nothing,
commandUsage = usagePackages "upgrade",
commandDefaultFlags = (mempty, defaultInstallFlags),
commandOptions = \showOrParseArgs ->
- liftOptionsFst (commandOptions cabalConfigureCommand showOrParseArgs)
+ liftOptionsFst (commandOptions configureCommand showOrParseArgs)
++ liftOptionsSnd [optionDryRun]
}
@@ -203,13 +200,13 @@ defaultInstallFlags = InstallFlags {
}
installCommand :: CommandUI (Cabal.ConfigFlags, InstallFlags)
-installCommand = cabalConfigureCommand {
+installCommand = configureCommand {
commandName = "install",
commandSynopsis = "Installs a list of packages.",
commandUsage = usagePackages "install",
commandDefaultFlags = (mempty, defaultInstallFlags),
commandOptions = \showOrParseArgs ->
- liftOptionsFst (commandOptions cabalConfigureCommand showOrParseArgs)
+ liftOptionsFst (commandOptions configureCommand showOrParseArgs)
++ liftOptionsSnd
(optionDryRun : optionRootCmd :
case showOrParseArgs of -- TODO: remove when "cabal install" avoids
More information about the Cvs-libraries
mailing list