[commit: packages/Cabal] ghc-head: Gently point the user in the direction of 'sandbox delete-source'. (05bcdb3)

git at git.haskell.org git at git.haskell.org
Mon Aug 26 23:22:47 CEST 2013


Repository : ssh://git@git.haskell.org/Cabal

On branch  : ghc-head
Link       : http://git.haskell.org/?p=packages/Cabal.git;a=commit;h=05bcdb3cd5a7d0db2f1a6be648becd4451f882af

>---------------------------------------------------------------

commit 05bcdb3cd5a7d0db2f1a6be648becd4451f882af
Author: Mikhail Glushenkov <the.dead.shall.rise at gmail.com>
Date:   Mon Apr 29 17:21:53 2013 +0200

    Gently point the user in the direction of 'sandbox delete-source'.
    
    We don't show that command in 'sandbox help' output by default, but if the user
    is running 'list-sources', she probably wants to know about it.


>---------------------------------------------------------------

05bcdb3cd5a7d0db2f1a6be648becd4451f882af
 cabal-install/Distribution/Client/Sandbox.hs |    9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/cabal-install/Distribution/Client/Sandbox.hs b/cabal-install/Distribution/Client/Sandbox.hs
index 0079c9b..1265673 100644
--- a/cabal-install/Distribution/Client/Sandbox.hs
+++ b/cabal-install/Distribution/Client/Sandbox.hs
@@ -334,7 +334,7 @@ sandboxDeleteSource verbosity buildTreeRefs _sandboxFlags globalFlags = do
 sandboxListSources :: Verbosity -> SandboxFlags -> GlobalFlags
                       -> IO ()
 sandboxListSources verbosity _sandboxFlags globalFlags = do
-  (_sandboxDir, pkgEnv) <- tryLoadSandboxConfig verbosity
+  (sandboxDir, pkgEnv) <- tryLoadSandboxConfig verbosity
                            (globalConfigFile globalFlags)
   indexFile             <- tryGetIndexFilePath (pkgEnvSavedConfig pkgEnv)
 
@@ -342,7 +342,12 @@ sandboxListSources verbosity _sandboxFlags globalFlags = do
   when (null refs) $
     notice verbosity $ "Index file '" ++ indexFile
     ++ "' has no references to local build trees."
-  mapM_ putStrLn refs
+  when (not . null $ refs) $ do
+    notice verbosity $ "Source dependencies registered "
+      ++ "in the current sandbox ('" ++ sandboxDir ++ "'):\n\n"
+    mapM_ putStrLn refs
+    notice verbosity $ "\nTo unregister source dependencies, "
+                       ++ "use the 'sandbox delete-source' command."
 
 -- | Invoke the @hc-pkg@ tool with provided arguments, restricted to the
 -- sandbox.





More information about the ghc-commits mailing list