diff options
author | Sibi Prabakaran <sibi@psibi.in> | 2015-12-07 11:16:15 +0100 |
---|---|---|
committer | Ben Gamari <ben@smart-cactus.org> | 2015-12-07 11:17:43 +0100 |
commit | 3d55e41e72dc32281744c52afea380c1db577ee1 (patch) | |
tree | 7904d021e08e3184c9acbe50cb89ae0ee349de52 /utils/ghc-pkg | |
parent | 42a5469e52d84a04df33f516fcb74ffa7ed70359 (diff) | |
download | haskell-3d55e41e72dc32281744c52afea380c1db577ee1.tar.gz |
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
Diffstat (limited to 'utils/ghc-pkg')
-rw-r--r-- | utils/ghc-pkg/Main.hs | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/utils/ghc-pkg/Main.hs b/utils/ghc-pkg/Main.hs index 993aa12ae9..b089e7b9c9 100644 --- a/utils/ghc-pkg/Main.hs +++ b/utils/ghc-pkg/Main.hs @@ -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 |