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>
Whitespace.
80-col violations.
Add license type UnspecifiedLicense.

Before this, AllrightsReservered had two separate meanings; the author
explicitly chose this license or not license was specified and therefore
defaults to AllRightsReserved.

The default license when no license is specified is now UnspecifiedLicense.

Closes: #2141
Merge pull request #2147 from erikd/master

Add license type UnspecifiedLicense.
Add Cabal and cabal-install version numbers when writing a new config file.

These values can be useful for debugging cabal issues.
Merge pull request #2152 from erikd/config

Add Cabal and cabal-install version numbers when writing a new config fi...
cabal-install/IndexUtils : Expose function getIndexFileAge.

* The function has type 'Repo -> IO Double'.
* It returns the age in days as a Double.
* Places that expected the age as an Int have been updated.
* Builds with ghc 7.4.2 and 7.8.3.
cabal-install/IndexUtils : Fix display of age now that its days as a Double.
Merge pull request #2150 from erikd/master

cabal-install/IndexUtils : Expose function getIndexFileAge.
Whitespace, 80-col violations.
Workaround for GHC issue 8825.
Merge pull request #2165 from 23Skidoo/ghc-issue-8825

Workaround for GHC issue 8825.
'cabal check': Add a warning for 'ghc-prof-options: -auto-all'.

Fixes #2162.
Cabal...Utils: Add functions listUnion/listUnion/ordNub/ordNubRight.

These functions are from Mikhail Glushenkov's cabal/ghc-options-union
branch.
Cabal: Add a NubList type with tests.

A NubList is a list where all elements are unique, but are maintained in
their original order. The Monoid NubList's mappend implement is just:

    NubList xs `mappend` NubList ys = NubList . nub $ xs ++ ys

which preserves NubList's required properties (ordering and unique-ness
of elements) and meets the requirements of the Monoid laws (identity,
associativity and closure).
cabal-install: Use NubList for list fields of SavedConfig.

User config fields like 'remote-repo', 'extra-prog-path' and 'build-summary'
were lists, which mean that when two SavedConfig types were concatentated
the lists for these fields were concatenated, resulting in duplicate entries.
Duplicated entries in these fields simply don't make sense, so we swicth to
NubList for these fields.

Closes: #2160
Merge pull request #2167 from erikd/nublist

Nublist
Make the default doc index file path compiler/arch/os-dependent.

Fixes #2135.