Repository : ssh://darcs.haskell.org//srv/darcs/ghc On branch : master
http://hackage.haskell.org/trac/ghc/changeset/55478b1ef856d47fba7e7dbd86baa88030d1b1cf >--------------------------------------------------------------- commit 55478b1ef856d47fba7e7dbd86baa88030d1b1cf Author: Ian Lynagh <[email protected]> Date: Thu Oct 11 21:31:00 2012 +0100 ghc-pkg: Print something when no packages are found; fixes #6119 We used to say $ ghc-pkg list blargle /usr/local/lib/ghc-7.4.1/package.conf.d which may imply that blargle was found in /usr/local/lib/ghc-7.4.1/package.conf.d >--------------------------------------------------------------- utils/ghc-pkg/Main.hs | 5 ++++- 1 files changed, 4 insertions(+), 1 deletions(-) diff --git a/utils/ghc-pkg/Main.hs b/utils/ghc-pkg/Main.hs index d992b54..0f5bd15 100644 --- a/utils/ghc-pkg/Main.hs +++ b/utils/ghc-pkg/Main.hs @@ -985,7 +985,10 @@ listPackages verbosity my_flags mPackageName mModuleName = do broken = map sourcePackageId (brokenPackages pkg_map) show_normal PackageDB{ location = db_name, packages = pkg_confs } = - hPutStrLn stdout $ unlines ((db_name ++ ":") : map (" " ++) pp_pkgs) + do hPutStrLn stdout (db_name ++ ":") + if null pp_pkgs + then hPutStrLn stdout " (no packages)" + else hPutStrLn stdout $ unlines (map (" " ++) pp_pkgs) where pp_pkgs = map pp_pkg pkg_confs pp_pkg p _______________________________________________ Cvs-ghc mailing list [email protected] http://www.haskell.org/mailman/listinfo/cvs-ghc
