Commit 3d55e41e authored by Sibi Prabakaran's avatar Sibi Prabakaran Committed by Ben Gamari
Browse files

ghc-pkg: Restore old behavior in colored version; fixes 6119

The behavior is changed to this:
```
ghc-pkg list blahblah
/home/sibi/ghc/inplace/lib/package.conf.d
    (no packages)
```
instead of:
```
ghc-pkg list blahblah
/home/sibi/ghc/inplace/lib/package.conf.d
```

Reviewers: austin, thomie, bgamari

Reviewed By: thomie, bgamari

Subscribers: thomie

Differential Revision: https://phabricator.haskell.org/D1575

GHC Trac Issues: #6119
parent 42a5469e
......@@ -1271,10 +1271,13 @@ listPackages verbosity my_flags mPackageName mModuleName = do
mapM_ show_normal stack
#else
let
show_colour withF db =
mconcat $ map (<#> termText "\n") $
(termText (location db) :
map (termText " " <#>) (map pp_pkg (packages db)))
show_colour withF db@PackageDB{ packages = pkg_confs } =
if null pkg_confs
then termText (location db) <#> termText "\n (no packages)\n"
else
mconcat $ map (<#> termText "\n") $
(termText (location db) :
map (termText " " <#>) (map pp_pkg pkg_confs))
where
pp_pkg p
| installedComponentId p `elem` broken = withF Red doc
......
Supports Markdown
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