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

On branch  : master

http://hackage.haskell.org/trac/ghc/changeset/beb52aaf431ff40c312939c42ca6aa158438889b

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

commit beb52aaf431ff40c312939c42ca6aa158438889b
Author: Duncan Coutts <[email protected]>
Date:   Thu Aug 14 18:53:04 2008 +0000

    Always print the message about nothing to install
    Not just if the user specified -v or --dry-run. Otherwise
    it's rather confusing. Also clarify that the reason there
    is nothing to install is because the latest versions are
    installed already. Also mention the --reinstall flag:
      Resolving dependencies...
      No packages to be installed. All the requested packages
      are already installed. If you want to reinstall anyway
      then use the --reinstall flag.

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

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

diff --git a/cabal-install/Distribution/Client/Install.hs 
b/cabal-install/Distribution/Client/Install.hs
index 3493355..f6caa4d 100644
--- a/cabal-install/Distribution/Client/Install.hs
+++ b/cabal-install/Distribution/Client/Install.hs
@@ -158,6 +158,13 @@ installWithPlanner planner verbosity packageDB repos comp 
conf configFlags insta
   case maybePlan of
     Left message -> die message
     Right installPlan -> do
+      let nothingToInstall = null (InstallPlan.ready installPlan)
+      when nothingToInstall $
+        notice verbosity $
+             "No packages to be installed. All the requested packages are "
+          ++ "already installed.\n If you want to reinstall anyway then use "
+          ++ "the --reinstall flag."
+
       when (dryRun || verbosity >= verbose) $
         printDryRun verbosity installPlan
 
@@ -284,7 +291,7 @@ planUpgradePackages comp _ _ =
 
 printDryRun :: Verbosity -> InstallPlan -> IO ()
 printDryRun verbosity plan = case unfoldr next plan of
-  []   -> notice verbosity "No packages to be installed."
+  []   -> return ()
   pkgs -> notice verbosity $ unlines $
             "In order, the following would be installed:"
           : map display pkgs



_______________________________________________
Cvs-libraries mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/cvs-libraries

Reply via email to