Commit eed458c7 authored by simonmar's avatar simonmar
Browse files

[project @ 2002-02-13 15:45:25 by simonmar]

Packages that come in by way of -package-conf files override default
packages (requested by Manuel Chakravarty).
parent 4e19ab1d
----------------------------------------------------------------------------- -----------------------------------------------------------------------------
-- $Id: DriverState.hs,v 1.68 2002/02/12 15:17:15 simonmar Exp $ -- $Id: DriverState.hs,v 1.69 2002/02/13 15:45:25 simonmar Exp $
-- --
-- Settings for the driver -- Settings for the driver
-- --
...@@ -440,12 +440,13 @@ readPackageConf conf_file = do ...@@ -440,12 +440,13 @@ readPackageConf conf_file = do
top_dir <- getTopDir top_dir <- getTopDir
let pkg_details = mungePackagePaths top_dir proto_pkg_details let pkg_details = mungePackagePaths top_dir proto_pkg_details
old_pkg_details <- readIORef v_Package_details old_pkg_details <- readIORef v_Package_details
let intersection = filter (`elem` map name old_pkg_details)
(map name pkg_details) let -- new package override old ones
if (not (null intersection)) new_pkg_names = map name pkg_details
then throwDyn (InstallationError ("package `" ++ head intersection ++ "' is already defined")) filtered_old_pkg_details =
else do filter (\p -> name p `notElem` new_pkg_names) old_pkg_details
writeIORef v_Package_details (pkg_details ++ old_pkg_details)
writeIORef v_Package_details (pkg_details ++ filtered_old_pkg_details)
addPackage :: String -> IO () addPackage :: String -> IO ()
addPackage package addPackage package
......
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