clean redunant imports in cabal-install\Distribution\Client: Environment.hs, Time.hs
Data.Bits: bitSize -> finiteBitSize
'Setup.hs sdist': invoke 'tar' with '--format ustar' if possible.

Fixes #1901. Some variants of 'tar' don't support the '--format' option, so we
have to do feature detection.

Note that 'cabal sdist' (as opposed to 'Setup.hs sdist') uses the built-in
tar.gz archiver ('Distribution.Client.Tar') and doesn't invoke 'tar' or 'gzip'.
Merge pull request #1903 from 23Skidoo/issue-1901

'Setup.hs sdist': invoke 'tar' with '--format ustar' if possible.
Append instead of prepending.

"-czf" must go first.
remove #if MIN_VERSION_base(4,5,0)
guard finiteBitSize with MIN_VERSION_base(4,7,0)
Merge pull request #2128 from Heather/bitSize

Data.Bits: bitSize -> finiteBitSize
Use 'dropWhileEnd' and 'takeWhileEnd'.

'[drop,take]WhileEnd p' is semantically the same as 'reverse . [drop,take]While
p . reverse', but more efficient and easier to read.
Use 'Char.isDigit' where appropriate.
Rename '[take,drop]WhileEnd' to '[take,drop]WhileEndLE'.

And move to 'D.S.Utils'.
Comments.
Comments.
Re-allow `configure-option` in config file (re #2122)

A couple of settings were filtered out since
74cb290986ba0b85c8a6455b88f5f4ce95c403c9 including
`configure-option`. However, it turns out you may want to
persist some options to `configure`, such as e.g.

  --configure-option=--build=x86_64-w64-mingw32

when working in a Cygwin host environment, but using a Mingw
toolchain (such as the one bundled with the Windows GHC bindist).

Approved by @dcoutts
Don't die when tar doesn't support '--help'.
alter cabal-install bootstrap.sh to not download the extra package
tarballs if these tarballs are already present.
allow cabal-install bootstrap.sh without user package database

This changes how the SCOPE_OF_INSTALLATION variable is used to provide
an alternate way of running bootstrap.sh which can install
cabal-install to a separate prefix and package database without
altering the user's package database or using it. The idea with this
is to improve the repeatability of automatically installing ghc, cabal
and other haskell independently of the current standard installation
or the user's main package database.

Usage example:

ghc-pkg init /home/jake/test_cabal/
SCOPE_OF_INSTALLATION='--global --package-db=/home/jake/test_cabal/packagedb' PREFIX=/home/jake/test_cabal/prefix ./bootstrap.sh

If you don't override the SCOPE_OF_INSTALLATION variable, bootstrap.sh
works as before.
bootstrap.sh: add comments on SCOPE_OF_INSTALLATION for custom package
database install
bootstrap.sh: fix the comment for SCOPE_OF_INSTALLATION
Merge pull request #2133 from JakeWheat/bootstrap-tweaks

Bootstrap tweaks