From 5517351ed7e7509ba217be6157632c9959074204 Mon Sep 17 00:00:00 2001 From: Daniel Gröber Date: Wed, 5 Aug 2015 09:30:59 +0200 Subject: Add support for returning package-db stack --- CabalHelper/Main.hs | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'CabalHelper') diff --git a/CabalHelper/Main.hs b/CabalHelper/Main.hs index 9d08b71..35af775 100644 --- a/CabalHelper/Main.hs +++ b/CabalHelper/Main.hs @@ -96,6 +96,7 @@ usage = do ++" | ghc-pkg-options [--with-inplace]\n" ++" | ghc-merged-pkg-options [--with-inplace]\n" ++" | ghc-lang-options [--with-inplace]\n" + ++" | package-db-stack\n" ++" | entrypoints\n" ++" | source-dirs\n" ++" ) ...\n" @@ -108,6 +109,7 @@ commands = [ "print-bli" , "ghc-src-options" , "ghc-pkg-options" , "ghc-lang-options" + , "package-db-stack" , "entrypoints" , "source-dirs"] @@ -221,6 +223,18 @@ main = do } return $ Just $ ChResponseCompList (res ++ [(ChSetupHsName, [])]) + "package-db-stack":[] -> do + let + pkgDbStr GlobalPackageDB = "G" + pkgDbStr UserPackageDB = "U" + pkgDbStr (SpecificPackageDB s) = "S" ++ s + + res <- map (\(c, opts) -> (c, map pkgDbStr $ ghcOptPackageDBs opts)) + <$> componentOptions' lvd False [] (\_ _ x -> return x) id + + -- TODO: Setup.hs has access to the sandbox as well: ghc-mod#478 + return $ Just $ ChResponseCompList $ (res :: [(ChComponentName, [String])]) ++ [(ChSetupHsName, [])] + "entrypoints":[] -> do eps <- componentsMap lbi v distdir $ \c clbi bi -> return $ componentEntrypoints c -- cgit v1.2.3