Refactor the way packages databases are handled

- cradle now stores a list of active package databases instead of only
  the user store (if present).

- rename `cradlePackageDb` -> `cradlePkgDbStack` as that`s what the ghc
  documentaion calls this kind of thing

- `getPackageDbPackages` now returns names of all visible packages in
  the given directory. Also the implementation now uses `ghc-pkg`
  instead of manually looking at the package database
This commit is contained in:
Daniel Gröber
2014-04-15 05:13:10 +02:00
parent 998a43ce24
commit 30b8366526
16 changed files with 271 additions and 187 deletions

View File

@@ -4,15 +4,15 @@
-- if you want to change the default settings for this sandbox.
local-repo: /home/me/work/ghc-mod/test/data/.cabal-sandbox/packages
logs-dir: /home/me/work/ghc-mod/test/data/.cabal-sandbox/logs
world-file: /home/me/work/ghc-mod/test/data/.cabal-sandbox/world
local-repo: @CWD@/test/data/.cabal-sandbox/packages
logs-dir: @CWD@/test/data/.cabal-sandbox/logs
world-file: @CWD@/test/data/.cabal-sandbox/world
user-install: False
package-db: /home/me/work/ghc-mod/test/data/.cabal-sandbox/i386-osx-ghc-7.6.3-packages.conf.d
build-summary: /home/me/work/ghc-mod/test/data/.cabal-sandbox/logs/build.log
package-db: @CWD@/test/data/.cabal-sandbox/i386-osx-ghc-7.6.3-packages.conf.d
build-summary: @CWD@/test/data/.cabal-sandbox/logs/build.log
install-dirs
prefix: /home/me/work/ghc-mod/test/data/.cabal-sandbox
install-dirs
prefix: @CWD@/test/data/.cabal-sandbox
bindir: $prefix/bin
libdir: $prefix/lib
libsubdir: $arch-$os-$compiler/$pkgid

View File

@@ -4,15 +4,15 @@
-- if you want to change the default settings for this sandbox.
local-repo: /home/me/work/ghc-mod/test/data/.cabal-sandbox/packages
logs-dir: /home/me/work/ghc-mod/test/data/.cabal-sandbox/logs
world-file: /home/me/work/ghc-mod/test/data/.cabal-sandbox/world
local-repo: @CWD@/test/data/.cabal-sandbox/packages
logs-dir: @CWD@/test/data/.cabal-sandbox/logs
world-file: @CWD@/test/data/.cabal-sandbox/world
user-install: False
package-db: test/data/check-packageid/.cabal-sandbox/i386-osx-ghc-7.6.3-packages.conf.d
build-summary: /home/me/work/ghc-mod/test/data/.cabal-sandbox/logs/build.log
build-summary: @CWD@/test/data/.cabal-sandbox/logs/build.log
install-dirs
prefix: /home/me/work/ghc-mod/test/data/.cabal-sandbox
install-dirs
prefix: @CWD@/test/data/.cabal-sandbox
bindir: $prefix/bin
libdir: $prefix/lib
libsubdir: $arch-$os-$compiler/$pkgid