Commit 97c6a729 authored by refold's avatar refold Committed by Mikhail Glushenkov
Browse files

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

parent 356bae16
......@@ -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"
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