Commit 9b371f7b authored by Duncan Coutts's avatar Duncan Coutts
Browse files

Do not pass Maybe LocalBuildInfo to clean hook

It is a bad idea for clean to do anything different depending
on whether the package was configured already or not. The
actual cleaning code did not use the LocalBuildInfo so this
only changes in the UserHooks interface. No Setup.hs scripts
actually make of this parameter for the clean hook.
Part of ticket #133.
parent 685fe44a
......@@ -276,17 +276,15 @@ haddockAction hooks flags args = do
cleanAction :: UserHooks -> CleanFlags -> Args -> IO ()
cleanAction hooks flags args = do
let distPref = fromFlag $ cleanDistPref flags
pbi <- preClean hooks args flags
mlbi <- maybeGetPersistBuildConfig distPref
pdfile <- defaultPackageDesc verbosity
ppd <- readPackageDescription verbosity pdfile
let pkg_descr0 = flattenPackageDescription ppd
let pkg_descr = updatePackageDescription pbi pkg_descr0
cleanHook hooks pkg_descr mlbi hooks flags
postClean hooks args flags pkg_descr mlbi
cleanHook hooks pkg_descr () hooks flags
postClean hooks args flags pkg_descr ()
where verbosity = fromFlag (cleanVerbosity flags)
copyAction :: UserHooks -> CopyFlags -> Args -> IO ()
......
......@@ -108,9 +108,9 @@ data UserHooks = UserHooks {
-- |Hook to run before clean command. Second arg indicates verbosity level.
preClean :: Args -> CleanFlags -> IO HookedBuildInfo,
-- |Over-ride this hook to get different behavior during clean.
cleanHook :: PackageDescription -> Maybe LocalBuildInfo -> UserHooks -> CleanFlags -> IO (),
cleanHook :: PackageDescription -> () -> UserHooks -> CleanFlags -> IO (),
-- |Hook to run after clean command. Second arg indicates verbosity level.
postClean :: Args -> CleanFlags -> PackageDescription -> Maybe LocalBuildInfo -> IO (),
postClean :: Args -> CleanFlags -> PackageDescription -> () -> IO (),
-- |Hook to run before copy command
preCopy :: Args -> CopyFlags -> IO HookedBuildInfo,
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment