Switch InstallPlan over to using IPID-indexed PackageIndex.

While this doesn't let us get rid of Distribution.Client.PackageIndex,
it does make InstallPlan more flexible, so we can have the same
package name-package version in the install plan multiple times.
We do this by synthesizing fake installed package IDs to act
as placeholders prior to compilation.

There is some shindig with 'FakeMap' in PackageIndex, check out
the Note in that file for more details.

This reverts commit a5a0f8e1959003ee702c04a23375a60d48f03f90, with
a bugfix for linearizeInstallPlan.

Fixes #2123
Better diagnostic information for install plans.

Signed-off-by: Edward Z. Yang <ezyang@cs.stanford.edu>
cabal-install: Fix PackageTests using user's config

- previously, tests did not specify config file; default one in ~/.cabal/
  was used. test result depended on non-repository content.
- now, PackageTester has extra parameter for config-file to use.
- the default procedure now is to generate a default config file in
  "PackageTests/cabal-config" and use that.
- specific tests also are able to use non-default config.
'writeFileAtomic': use default permissions.

Fixes #2078.
cabal-install/tests: Fix variable names; Remove printf debugging
cabal-install/tests: Clean up relative path mess

- add struct PackageTests.PackageTester.TestsPaths
- contains absolute paths for cabal, ghc, cabal-config
- refactor to consequently use this as input for all tests
Merge pull request #2190 from lspitzner/tests

cabal-install: Fix PackageTests using user's config
Improve a warning.

Fixes #2195.
Remove build-depends from pkgDescrFieldDescrs

Signed-off-by: Edward Z. Yang <ezyang@cs.stanford.edu>
Merge pull request #2072 from ezyang/ezyang-remove-build-depends

Remove build-depends from pkgDescrFieldDescrs
Merge pull request #2142 from ezyang/ezyang-edge

Switch InstallPlan over to using IPID-indexed PackageIndex.
Build Haddock documentation on Travis.

Fixes #2198.
Fix invalid Haddock syntax.
Consolidate exposed-modules and reexported-modules in InstalledPackageInfo.

A note first: this patch does NOT modify the user-facing experience in Cabal
files; it only changes how we register information in the installed package
database.

This patch takes the exposed-modules and reexported-modules fields in
the InstalledPackageInfo structure and consolidates them into just the
exposed module fields, which now has a Maybe flag indicating if a
module is reexported and, if it is, what the original module was.  I've
also added in a field for signatures although it is currently unused.

The big benefit of this change is that it will make processing at the GHC level
much more uniform when we add signatures: signatures can also be reexported
and the new representation means we can share the code.

Signed-off-by: Edward Z. Yang <ezyang@cs.stanford.edu>
Merge pull request #2197 from ezyang/ezyang-exposed-modules

Consolidate exposed-modules and reexported-modules in InstalledPackageInfo
Comment.
'sandbox delete': exit with 0 when there's no sandbox.

Fixes #2203.
'sandbox delete': exit with 0 even with 'require-sandbox: True'
Merge pull request #2204 from lspitzner/sandbox-delete

'sandbox delete': exit with 0 even with 'require-sandbox: True'
Bug fix: packagesThatDependOn should go through the fake map.

This fix got dropped shuffling PRs around when we committed
ff6c718be2cca2ac31eb461e9ca777e1f149b5a1