Make cabal-install build with Cabal-1.16.
Ensure that the cabal-install logfile gets closed

cabal was failing with:

$ cabal --config-file=/home/hackage-docs/hackage-docs/build-cache/cabal-config install --enable-documentation --enable-tests --haddock-html-location='http://192.168.142.1:8080/package/$pkg-$version/doc' --haddock-option=--built-in-themes --haddock-contents-location='http://192.168.142.1:8080/package/$pkg-$version' --haddock-hyperlink-source --prefix=/home/hackage-docs/hackage-docs/build-cache HUnit-1.2.5.1
Resolving dependencies...
/home/hackage-docs/hackage-docs/build-cache/local.conf.d/package.cache: openBinaryFile: does not exist (No such file or directory)
cabal: /home/hackage-docs/.cabal/logs/HUnit-1.2.5.1.log: resource busy

as it tried to open the log file for reading when it already had it open
for writing:

open("/home/hackage-docs/.cabal/logs/HUnit-1.2.5.1.log", O_WRONLY|O_CREAT|O_NOCTTY|O_APPEND|O_NONBLOCK, 0666) = 3
open("/home/hackage-docs/.cabal/logs/HUnit-1.2.5.1.log", O_RDONLY|O_NOCTTY|O_NONBLOCK) = 5
close(5)                                = 0
close(3)                                = 0
Make 'D.C.PackageEnvironment' compile again.

The compiler didn't complain when I tested on 'package-environment-file' branch
because Main.hs didn't depend on this module.
Typos.
Allow invoking 'hc-pkg init' via D.S.Program.HcPkg.
Add an 'initPackageDB' function to D.S.Register.

Creates an empty package DB at the specified location.
Build Setup executables without HPC. Fixes #1012.
add test for non-vanilla profiling and dynamic builds with Template Haskell
Fix the logic for building profiled executables with TemplateHaskell.

This was broken in 5f50fb1: Instead of a vanilla version, the code would
build a profiling version of the objects for TH.
Fix logic for building dynamic executables with TemplateHaskell
don't test --disable-library-vanilla for now

It's not supported by the ghc-pkg program.
Make 'buildOptions' a top-level function.

Allows it to be reused.
Merge with cabal-1.16
Declarative descriptions of the preliminary sandbox UI commands.
Replace a 'notice' with a debug message.
Implement the preliminary sandbox UI.

Adds five new hidden commands:

    cabal sandbox-configure
    cabal sandbox-add-source
    cabal sandbox-build
    cabal sandbox-install
    cabal dump-pkgenv
Merge pull request #1011 from 23Skidoo/cabal-sandbox
Make 'install --dry-run' print the latest available version of a package.

Print the latest available version of a package when the solver has picked a
different version for some reason. Inspired by Brent Yorgey's highlight-versions
tool [1].

Example of output:

$ cabal install --dry-run repa
Resolving dependencies...
In order, the following would be installed (use -v for more details):
primitive-0.4.1
random-1.0.1.1
QuickCheck-2.4.2 (latest: 2.5)
vector-0.9.1
repa-3.2.1.1

$ cabal install --dry-run repa -v
Reading available packages...
Choosing modular solver.
Resolving dependencies...
In order, the following would be installed:
primitive-0.4.1 (new package)
random-1.0.1.1 (new package)
QuickCheck-2.4.2 (latest: 2.5) (new package)
vector-0.9.1 (new package)
repa-3.2.1.1 (new package)

[1] http://byorgey.wordpress.com/2012/08/25/identifying-outdated-packages-in-cabal-install-plans/
fix printing of latest versions for packages that are not on hackage
Merge pull request #1018 from soenkehahn/master

fixed crash when printing latest versions with 'cabal install'