From: simonmar Date: Fri, 3 Dec 2004 13:01:28 +0000 (+0000) Subject: [project @ 2004-12-03 13:01:28 by simonmar] X-Git-Tag: Initial_conversion_from_CVS_complete~1367 X-Git-Url: http://git.megacz.com/?a=commitdiff_plain;h=2153d073d2799c8e1f588115df33fac945838252;p=ghc-hetmet.git [project @ 2004-12-03 13:01:28 by simonmar] Support the --auto-ghci-libs option in conjuction with 'register'. --- diff --git a/ghc/utils/ghc-pkg/Main.hs b/ghc/utils/ghc-pkg/Main.hs index 964678c..c9dd5d4 100644 --- a/ghc/utils/ghc-pkg/Main.hs +++ b/ghc/utils/ghc-pkg/Main.hs @@ -104,6 +104,7 @@ data Flag | FlagConfig FilePath | FlagGlobalConfig FilePath | FlagForce + | FlagAutoGHCiLibs deriving Eq flags :: [OptDescr Flag] @@ -118,6 +119,8 @@ flags = [ "location of the global package config", Option [] ["force"] (NoArg FlagForce) "ignore missing dependencies, directories, and libraries", + Option ['g'] ["auto-ghci-libs"] (NoArg FlagAutoGHCiLibs) + "automatically build libs for GHCi (with register)", Option ['?'] ["help"] (NoArg FlagHelp) "display this help and exit", Option ['V'] ["version"] (NoArg FlagVersion) @@ -175,13 +178,14 @@ runit cli nonopts = do db_stack <- mapM readParseDatabase dbs let force = FlagForce `elem` cli + auto_ghci_libs = FlagAutoGHCiLibs `elem` cli -- -- first, parse the command case nonopts of ["register", filename] -> - registerPackage filename [] db_stack False False force + registerPackage filename [] db_stack auto_ghci_libs False force ["update", filename] -> - registerPackage filename [] db_stack False True force + registerPackage filename [] db_stack auto_ghci_libs True force ["unregister", pkgid_str] -> do pkgid <- readPkgId pkgid_str unregisterPackage db_stack pkgid