[commit: Cabal] master: Simplify the way we derive configure, install and upgrade commands (4e04cb1)

Ian Lynagh igloo at earth.li
Fri Jun 24 01:52:43 CEST 2011


Repository : ssh://darcs.haskell.org//srv/darcs/packages/Cabal

On branch  : master

http://hackage.haskell.org/trac/ghc/changeset/4e04cb1e13183fe2c2e6847d9390ff01b2794ed6

>---------------------------------------------------------------

commit 4e04cb1e13183fe2c2e6847d9390ff01b2794ed6
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