Commit 825ef1e2 authored by Mikhail Glushenkov's avatar Mikhail Glushenkov
Browse files

Improve an error message.

See #1397.
parent ddeb0eca
...@@ -26,6 +26,7 @@ import System.FilePath ((<.>), (</>)) ...@@ -26,6 +26,7 @@ import System.FilePath ((<.>), (</>))
import qualified Data.Map as M import qualified Data.Map as M
import Distribution.Compiler (CompilerId) import Distribution.Compiler (CompilerId)
import Distribution.Package (packageName)
import Distribution.PackageDescription.Configuration (flattenPackageDescription) import Distribution.PackageDescription.Configuration (flattenPackageDescription)
import Distribution.PackageDescription.Parse (readPackageDescription) import Distribution.PackageDescription.Parse (readPackageDescription)
import Distribution.Simple.Setup (Flag (..), import Distribution.Simple.Setup (Flag (..),
...@@ -228,8 +229,14 @@ allPackageSourceFiles verbosity packageDir = inDir (Just packageDir) $ do ...@@ -228,8 +229,14 @@ allPackageSourceFiles verbosity packageDir = inDir (Just packageDir) $ do
useCabalVersion = orLaterVersion $ Version [1,17,0] [] useCabalVersion = orLaterVersion $ Version [1,17,0] []
} }
onFailedListSources :: IO ()
onFailedListSources = do
warn verbosity $ "Couldn't list sources of the package '"
++ display (packageName pkg) ++ "'"
removeExistingFile file
-- Run setup sdist --list-sources=TMPFILE -- Run setup sdist --list-sources=TMPFILE
(flip finally) (removeExistingFile file) $ do (flip finally) (onFailedListSources) $ do
setupWrapper verbosity setupOpts (Just pkg) sdistCommand (const flags) [] setupWrapper verbosity setupOpts (Just pkg) sdistCommand (const flags) []
srcs <- fmap lines . readFile $ file srcs <- fmap lines . readFile $ file
mapM tryCanonicalizePath srcs mapM tryCanonicalizePath srcs
......
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