Ticket #2441 (closed bug: fixed)
Ghc-pkg cannot unregister/expose/hide packages in non-first package databases
| Reported by: | batterseapower | Owned by: | simonmar |
|---|---|---|---|
| Priority: | normal | Milestone: | 6.10.1 |
| Component: | Build System | Version: | 6.9 |
| Keywords: | Cc: | ||
| Operating System: | Unknown/Multiple | Architecture: | Unknown/Multiple |
| Type of failure: | Difficulty: | Unknown | |
| Test Case: | Blocked By: | ||
| Blocking: | Related Tickets: |
Description
I was in this situation:
$ ghc-pkg list
/usr/local/lib/ghc-6.8.2/package.conf:
Cabal-1.2.3.0, Cabal-1.5.1, Finance-Quote-Yahoo-0.4.1,
GLUT-2.1.1.1, HTTP-3001.0.4, HTTP-Simple-0.1, HUnit-1.2.0.0,
OpenAL-1.3.1.1, QuickCheck-1.1.0.0, array-0.1.0.0, base-3.0.1.0,
binary-0.4.1, bytestring-0.9.0.1, cgi-3001.1.5.1,
containers-0.1.0.1, directory-1.0.0.0, fgl-5.4.1.1,
filepath-1.1.0.0, (ghc-6.8.2), haskell-src-1.0.1.1,
haskell98-1.0.1.0, hpc-0.5.0.0, html-1.0.1.1, hxt-7.4, mtl-1.1.0.0,
network-2.1.0.0, old-locale-1.0.0.0, old-time-1.0.0.0,
packedstring-0.1.0.0, parallel-1.0.0.0, parsec-2.1.0.0,
plugins-1.0, plugins-1.1, pretty-1.0.0.0, process-1.0.0.0,
random-1.0.0.0, readline-1.0.1.0, regex-base-0.72.0.1,
regex-compat-0.71.0.1, regex-posix-0.72.0.2, rts-1.0, stm-2.1.1.0,
template-haskell-2.2.0.0, time-1.1.2.0, unix-2.3.0.0,
xhtml-3000.0.2.1, zlib-0.4.0.4
/Users/mbolingbroke/.ghc/i386-darwin-6.8.2/package.conf:
Cabal-1.4.0.0, GLUT-2.1.1.1, HDBC-1.1.4, MaybeT-0.1.1,
MonadRandom-0.1.1, OpenGL-2.2.1.1, Stream-0.2.3, arrows-0.4,
category-extras-0.53.4, haddock-2.1.0
And from there I can do this:
$ ../../../../ghc.plugins/utils/ghc-pkg/ghc-pkg-inplace describe pan-plugin-annotations name: pan-plugin-annotations version: 1.0 license: BSD3 copyright: (c) Sean Seefried 2008 maintainer: sseefried@cse.unsw.edu.au stability: stable homepage: ...
But not this!
$ ../../../../ghc.plugins/utils/ghc-pkg/ghc-pkg-inplace expose pan-plugin-annotations-1.0 ghc-pkg-inplace: cannot find package pan-plugin-annotations-1.0
Or this:
$ ../../../../ghc.plugins/utils/ghc-pkg/ghc-pkg-inplace hide pan-plugin-annotations-1.0 ghc-pkg-inplace: cannot find package pan-plugin-annotations-1.0
The reason is that ghc-pkgs modifyPackage function only looks in the FIRST package database in the list. In my opinion, it should look in all databases and either:
1. Perform the modification requested by the user to the first database that contains the relevant package
2. Show a smart error message indicating to the user that they need to use some flags to bring that package to the front of the package stack if they want to do that, rather than just saying "not found"
I've attached a patch that implements behaviour 1.
Attachments
Change History
Note: See
TracTickets for help on using
tickets.

