Commit 55478b1e authored by ian@well-typed.com's avatar ian@well-typed.com
Browse files

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
parent e9b12562
......@@ -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
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment