Avoid the timestamp check for `add-source --snapshot` dependencies.

Snapshot deps now behave more like `cabal-dev add-source`. Implemented by adding
a BuildTreeRefType field to the BuildRef index entry.

Fixes #1321.
Merge pull request #1322 from 23Skidoo/snapshots-avoid-timestamp-check

Avoid the timestamp check for `add-source --snapshot` dependencies.
Add a debug message.
Fix another issue caused by 'user-install: True'.

I'm starting to think that it's better to set it to False and solve the rootCmd
problem in another way.
Add a generalised variant of 'topHandler'.
Don't die if some deps weren't reinstalled.
Use globalInstallDirs as the sandbox location.

Reverts 7b2e3630f2ada8a56bf9100144e1bb9acbe6dc6a. Instead of temporarily setting
'configUserInstall' to 'False' in various places, we now just check that we're
not in a sandbox when deciding whether we should use 'rootCmd'.
Add an '--only' flag for 'build', 'test' and 'bench'.

Allows to skip the automatic reinstallation of add-source deps.
Merge pull request #1327 from 23Skidoo/skip-add-source-check

Add an '--only' flag for 'build', 'test', 'bench' and 'run'.
init: generate build-depends with >=x.x && <x.y syntax instead of ==x.*

fixes #1329.
Add a function for reading the contents of a single package DB.

'getInstalledPackages' requires to pass in a 'PackageDBStack'.
Add a function for listing packages installed in a sandbox.
Make failReadE use the error message supplied
Merge pull request #1330 from zopa/master

Bugfix to failReadE in Distribution.ReadE
Instead of pruning, make an install plan for the whole environment.

Previously, we used a hack for reinstalling reverse dependencies: we created an
install plan for the sandboxed package and the modified add-source deps and then
pruned the sandboxed package from it. This missed those revdeps that the
sandboxed package didn't depend on and also broke the sandboxed package if it
was installed in the sandboxed package DB (see #1229).

This commit replaces that hack with a more principled approach: we create a plan
for the whole environment (all packages installed in the sandbox), constraining
the modified add-source deps to be reinstalled and the already installed
packages to be preferably not.

Fixes #1229.
Merge pull request #1315 from 23Skidoo/plan-whole-environment

Instead of pruning, make an install plan for the whole environment.
Implement a haskell-suite compiler support