Commit 993487d7 authored by Duncan Coutts's avatar Duncan Coutts
Browse files

Fix register --global/--user

It is a rather silly feature and is not guaranteed to work. Having
configured and built using one set of dbs, there's no guarantee you
can register into another set. We should probably just remove it.
parent dcf82732
......@@ -112,7 +112,8 @@ import System.IO.Error (try)
import Data.Maybe
( isJust, fromMaybe, maybeToList )
import Data.List (partition)
import Data.List
( partition, nub )
-- -----------------------------------------------------------------------------
......@@ -143,8 +144,11 @@ register pkg@PackageDescription { library = Just lib }
modeGenerateRegScript = fromFlag (regGenScript regFlags)
inplace = fromFlag (regInPlace regFlags)
packageDbs = withPackageDB lbi
++ maybeToList (flagToMaybe (regPackageDB regFlags))
-- FIXME: there's really no guarantee this will work.
-- registering into a totally different db stack can
-- fail if dependencies cannot be satisfied.
packageDbs = nub $ withPackageDB lbi
++ maybeToList (flagToMaybe (regPackageDB regFlags))
distPref = fromFlag (regDistPref regFlags)
verbosity = fromFlag (regVerbosity regFlags)
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