[commit: packages/Cabal] ghc-head: Don't tell the user about the temporary directory used by sdist. (97c6a72)

git at git.haskell.org git at git.haskell.org
Mon Aug 26 23:24:05 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=97c6a72984931f4ccf628736024d3459a033af6c

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

commit 97c6a72984931f4ccf628736024d3459a033af6c
Author: Mikhail Glushenkov <the.dead.shall.rise at gmail.com>
Date:   Wed May 1 22:54:54 2013 +0200

    Don't tell the user about the temporary directory used by sdist.


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

97c6a72984931f4ccf628736024d3459a033af6c
 cabal-install/Distribution/Client/SrcDist.hs |   14 ++++++++++----
 1 file changed, 10 insertions(+), 4 deletions(-)

diff --git a/cabal-install/Distribution/Client/SrcDist.hs b/cabal-install/Distribution/Client/SrcDist.hs
index 71bd9e0..379c7c1 100644
--- a/cabal-install/Distribution/Client/SrcDist.hs
+++ b/cabal-install/Distribution/Client/SrcDist.hs
@@ -29,7 +29,7 @@ import Distribution.Simple.BuildPaths ( srcPref)
 import Distribution.Simple.Program (requireProgram, simpleProgram, programPath)
 import Distribution.Simple.Program.Db (emptyProgramDb)
 import Distribution.Text ( display )
-import Distribution.Verbosity (Verbosity)
+import Distribution.Verbosity (Verbosity, lessVerbose, normal)
 import Distribution.Version   (Version(..), orLaterVersion)
 
 import System.FilePath ((</>), (<.>))
@@ -50,8 +50,11 @@ sdist flags exflags = do
   createDirectoryIfMissingVerbose verbosity True tmpTargetDir
   withDir $ \tmpDir -> do
     let outDir = if isOutDirectory then tmpDir else tmpDir </> tarBallName pkg
-        flags' = if isOutDirectory then flags
-                 else flags { sDistDirectory = Flag outDir }
+        flags' = (if isOutDirectory then flags
+                  else flags { sDistDirectory = Flag outDir })
+                 { sDistVerbosity = Flag $ if   verbosity == normal
+                                           then lessVerbose verbosity
+                                           else verbosity }
 
     createDirectoryIfMissingVerbose verbosity True outDir
 
@@ -63,6 +66,9 @@ sdist flags exflags = do
     unless (isListSources || isOutDirectory) $
       createArchive verbosity pkg tmpDir distPref
 
+    when isOutDirectory $
+      notice verbosity $ "Source directory created: " ++ tmpTargetDir
+
   where
     flagEnabled f  = not . null . flagToList . f $ flags
 
@@ -123,6 +129,6 @@ createZipArchive verbosity pkg tmpDir targetPref = do
     unless (exitCode == ExitSuccess) $
       die $ "Generating the zip file failed "
          ++ "(zip returned exit code " ++ show exitCode ++ ")"
-    notice verbosity $ "Source zip archive created: " ++ zipfileAbs
+    notice verbosity $ "Source zip archive created: " ++ zipfile
   where
     zipProgram = simpleProgram "zip"





More information about the ghc-commits mailing list