haskell/haskell-platform — pull request #120 by randen (2014-07-09 10:05:45+00:00)
Title: Refactoring in preparation for Windows build

These 4 commits are done separately from the upcoming Windows build changes, in the hope that the Windows-specific changes will be more compartmentalized and easier to review.

Correct spelling of "package.conf.d"

* hptool/src/Paths.hs
* hptool/src/Target.hs
--------
Factor out localCommand into new file

The functions localCommand and localCommand'
(also helper function addPath') are moved from GhcDist
to a new file, hptool/src/LocalCommand.hs. This
change allows these functions to now be used by the
OS-specific files, by preventing an import cycle. The
other files included in this commit simply have their
imports modified (and note that most modules which
were importing GhcDist were doing so only for
localCommand.

* hptool/src/GhcDist.hs
* hptool/src/HaddockMaster.hs
* hptool/src/LocalCommand.hs
* hptool/src/Package.hs
* hptool/src/SourceTarballs.hs
* hptool/src/Target.hs
--------
Clean up Utils.shakeToCabalVerbosity

Rather than use magic numbers which are needed when
issuing an external command to the cabal executable,
we can actually use Cabal's API value for verbosity,
then use fromEnum to convert back to an integer.
This change makes this function useable for mapping
Shake's verbosity to the Cabal API's verbosity.

hptool/src/Target.hs is modified to track this change.
--------
Refactor Templates to expose platformExpander

This is needed to support the Windows build.