[commit: packages/Cabal] ghc-head: Improve an error message. (825ef1e)

git at git.haskell.org git at git.haskell.org
Mon Aug 26 23:28:53 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=825ef1e20766248f68771846928e0093b207c032

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

commit 825ef1e20766248f68771846928e0093b207c032
Author: Mikhail Glushenkov <mikhail.glushenkov at gmail.com>
Date:   Wed Jul 24 05:26:22 2013 +0200

    Improve an error message.
    
    See #1397.


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

825ef1e20766248f68771846928e0093b207c032
 cabal-install/Distribution/Client/Sandbox/Timestamp.hs |    9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/cabal-install/Distribution/Client/Sandbox/Timestamp.hs b/cabal-install/Distribution/Client/Sandbox/Timestamp.hs
index 699e50d..fa2495b 100644
--- a/cabal-install/Distribution/Client/Sandbox/Timestamp.hs
+++ b/cabal-install/Distribution/Client/Sandbox/Timestamp.hs
@@ -26,6 +26,7 @@ import System.FilePath                               ((<.>), (</>))
 import qualified Data.Map as M
 
 import Distribution.Compiler                         (CompilerId)
+import Distribution.Package                          (packageName)
 import Distribution.PackageDescription.Configuration (flattenPackageDescription)
 import Distribution.PackageDescription.Parse         (readPackageDescription)
 import Distribution.Simple.Setup                     (Flag (..),
@@ -228,8 +229,14 @@ allPackageSourceFiles verbosity packageDir = inDir (Just packageDir) $ do
         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
-  (flip finally) (removeExistingFile file) $ do
+  (flip finally) (onFailedListSources) $ do
     setupWrapper verbosity setupOpts (Just pkg) sdistCommand (const flags) []
     srcs <- fmap lines . readFile $ file
     mapM tryCanonicalizePath srcs





More information about the ghc-commits mailing list