Commit 02ac5ebf authored by Duncan Coutts's avatar Duncan Coutts
Browse files

Rewrite the Register module

It was getting increasingly convoluted and incomprehensible.
Now uses the Program.HcPkg and Program.Scripts modules.
parent af3da760
...@@ -95,7 +95,7 @@ import Distribution.Simple.Command ...@@ -95,7 +95,7 @@ import Distribution.Simple.Command
import Distribution.Simple.Build ( build ) import Distribution.Simple.Build ( build )
import Distribution.Simple.SrcDist ( sdist ) import Distribution.Simple.SrcDist ( sdist )
import Distribution.Simple.Register import Distribution.Simple.Register
( register, unregister, removeRegScripts ) ( register, unregister )
import Distribution.Simple.Configure import Distribution.Simple.Configure
( getPersistBuildConfig, maybeGetPersistBuildConfig ( getPersistBuildConfig, maybeGetPersistBuildConfig
...@@ -385,9 +385,6 @@ clean pkg_descr flags = do ...@@ -385,9 +385,6 @@ clean pkg_descr flags = do
exists <- doesDirectoryExist distPref exists <- doesDirectoryExist distPref
when exists (removeDirectoryRecursive distPref) when exists (removeDirectoryRecursive distPref)
-- these live in the top level dir so must be removed separately
removeRegScripts
-- Any extra files the user wants to remove -- Any extra files the user wants to remove
mapM_ removeFileOrDirectory (extraTmpFiles pkg_descr) mapM_ removeFileOrDirectory (extraTmpFiles pkg_descr)
......
...@@ -107,8 +107,6 @@ import Distribution.Simple.Utils ...@@ -107,8 +107,6 @@ import Distribution.Simple.Utils
, intercalate, comparing, cabalVersion, cabalBootstrapping , intercalate, comparing, cabalVersion, cabalBootstrapping
, withFileContents, writeFileAtomic , withFileContents, writeFileAtomic
, withTempFile ) , withTempFile )
import Distribution.Simple.Register
( removeInstalledConfig )
import Distribution.System import Distribution.System
( OS(..), buildOS, buildArch ) ( OS(..), buildOS, buildArch )
import Distribution.Version import Distribution.Version
...@@ -403,8 +401,6 @@ configure (pkg_descr0, pbi) cfg ...@@ -403,8 +401,6 @@ configure (pkg_descr0, pbi) cfg
| (name, uses) <- inconsistencies | (name, uses) <- inconsistencies
, (pkg, ver) <- uses ] , (pkg, ver) <- uses ]
removeInstalledConfig distPref
-- installation directories -- installation directories
defaultDirs <- defaultInstallDirs flavor userInstall (hasLibs pkg_descr) defaultDirs <- defaultInstallDirs flavor userInstall (hasLibs pkg_descr)
let installDirs = combineInstallDirs fromFlagOrDefault let installDirs = combineInstallDirs fromFlagOrDefault
......
This diff is collapsed.
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