Use import list to hide new System.Exit.die

Starting with GHC 7.10 (and soon GHC HEAD), System.Exit exports the new `die`
which would clash with Cabal's own `die`. See also

  https://ghc.haskell.org/trac/ghc/ticket/9016

For more details.

(cherry picked from commit 322ddbc019bf2386897b9b9be7d534cc0e4d39c1)
Revert "'cabal configure': honor the '--constraint' flag."

This commit caused cabal to no longer try to run configure if the
dependency solver failed, causing e.g. the containers test suite to no
longer build.

This reverts commit 16836efe96c6e7deb80ef9103edc236f872ae090.
Add OS and arch to HTTP user-agent string

This makes the HTTP user-agent field look like so:

    User-Agent: cabal-install/1.21.0.0 (linux; x86_64)

This allows us to gather more statistics about our user-base as
with the current user-agent string we can only do a rough break-down by
cabal-install version numbers.

(cherry picked from commit bd0fcd55d7cc98e9155569684f9a749938360c0c)
Platform dependent search path separator

When using cabal exec on Windows, it would give an error such as:

ghc.exe: can't find a package database at
C:\Users\tchakkazulu\path\to\dir\.cabal-sandbox\i386-windows-ghc-7.6.3-packages.conf.d:C:\Program
Files (x86)\Haskell Platform\2013.2.0.0\lib\package.conf.d

(cherry picked from commit 12deea33d0b3c4090abe47ec5f30ae57217e10d0)

Conflicts:
	cabal-install/Main.hs
Bump cabal-install version number to 1.20.0.1
Add some tests of our Haddock support
Bring a Haddock version check in line with message
Remove support for Haddock versions < 2.0

Dropping this support is unlikely to be a problem in practice.  Debian
oldstable is currently on version 2.6.0 of Haddock, for example.

This change enables future code simplification.  Currently we
preprocess both Haskell files requiring the CPP and Literate Haskell
files; newer versions of Haddock can handle these natively.

Fixes issue #1718.
Use Haddock's builtin support for .lhs and CPP

This is a code simplification on our end.

Thanks to Mikhail Glushenkov for the suggestion.
Fix: "cabal haddock" uses CPP overzealously

Until recently we supported ancient versions of Haddock, pre v2.0.  To
support the CPP extension with such versions, cabal had to invoke the
CPP before invoking Haddock on the output.  For simplicity cabal would
invoke the CPP on all Haskell files, if any Haskell file required CPP.
However, invoking CPP on a file which does not require it can cause
build failures.

Haddock v2.0+ supports the CPP via GHC, and even automatically
preprocesses any file with the {-# LANGUAGE CPP #-} pragma. Hence we
simply need only tell Haddock to enable the CPP when the CPP is a
package level default extension.

Fixes issue #1808.
Print full build log instead of only the last 10 lines
Merge pull request #1856 from BardurArantsson/print-full-log

Print full build log instead of only the last 10 lines
Merge pull request #1854 from iainnicol/haddock

Haddock support improvements
Revert "pass --no-check-certificate to wget"

This reverts commit 4167869874070d3aba1b6a8daadcd7ee6f96dbfc.

See discussion in #1796.
Helped extra-ghci-libraries find its way to .cabal files.
Merge pull request #1866 from bitemyapp/master

fixed documentation for hc-pkg hide
Re-order CC options.

A default -O2 coming second over-rides packages that specify -O3.
Among other issues, this means expected AVX instructions are not being
generated and performance takes orders of magnitude dive in some cases.
Add --enable-{tests,benchmarks} to freeze command

If they are present the dependencies of all test and benchmark stanzas are
included in the frozen set of dependencies.
Tests for the freeze command

Introduced a new test-suite, package-tests, which is intended for black-box
testing of the cabal binary.

The `PackageTests` module determines which cabal binary is to be tested and
runs the tests passing each of them the path to that binary. The binary is the
first cabal binary found on the path. To test a different binary, adjust the
PATH environment variable.

The `PackageTests.PackageTester` module contains common routines to execute
the cabal binary and check its results.

Finally, the `PackageTests.Freeze.Check` command contains some tests for the
freeze command.
PackageTester uses D.S.Utils.printRawCommandAndArgs