[commit: Cabal] : show optional stanzas when printing install plans (77fd556)

Ian Lynagh igloo at earth.li
Fri Feb 17 20:34:19 CET 2012


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

On branch  : 

http://hackage.haskell.org/trac/ghc/changeset/77fd55686417c25212b07c500477bf8ecbdff338

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

commit 77fd55686417c25212b07c500477bf8ecbdff338
Author: Andres Loeh <andres at well-typed.com>
Date:   Sat Feb 11 15:59:29 2012 +0000

    show optional stanzas when printing install plans

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

 cabal-install/Distribution/Client/Install.hs |   12 +++++++++++-
 1 files changed, 11 insertions(+), 1 deletions(-)

diff --git a/cabal-install/Distribution/Client/Install.hs b/cabal-install/Distribution/Client/Install.hs
index c69e924..318d6f4 100644
--- a/cabal-install/Distribution/Client/Install.hs
+++ b/cabal-install/Distribution/Client/Install.hs
@@ -430,7 +430,8 @@ printDryRun verbosity plan = case plan of
       : map (display . packageId) (map fst pkgs)
   where
     showPkgAndReason (pkg', pr) = display (packageId pkg') ++
-          showFlagAssignment (nonDefaultFlags pkg') ++ " " ++
+          showFlagAssignment (nonDefaultFlags pkg') ++
+          showStanzas (stanzas pkg') ++ " " ++
           case pr of
             NewPackage   -> "(new package)"
             NewVersion _ -> "(new version)"
@@ -448,7 +449,16 @@ printDryRun verbosity plan = case plan of
              (genPackageFlags (Source.packageDescription spkg))
       in  fa \\ defaultAssignment
 
+    stanzas :: ConfiguredPackage -> [OptionalStanza]
+    stanzas (ConfiguredPackage _ _ sts _) = sts
+
+    showStanzas :: [OptionalStanza] -> String
+    showStanzas = concatMap ((' ' :) . showStanza)
+    showStanza TestStanzas  = "*test"
+    showStanza BenchStanzas = "*bench"
+
     -- FIXME: this should be a proper function in a proper place
+    showFlagAssignment :: FlagAssignment -> String
     showFlagAssignment = concatMap ((' ' :) . showFlagValue)
     showFlagValue (f, True)   = '+' : showFlagName f
     showFlagValue (f, False)  = '-' : showFlagName f





More information about the Cvs-libraries mailing list