[commit: packages/Cabal] ghc-head: If we can't list sources, assume that the dependency hasn't changed. (473123e)

git at git.haskell.org git at git.haskell.org
Mon Aug 26 23:28:59 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=473123e6d2cbfdcdd4e1a24be6f7bdf6a44bec05

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

commit 473123e6d2cbfdcdd4e1a24be6f7bdf6a44bec05
Author: Mikhail Glushenkov <mikhail.glushenkov at gmail.com>
Date:   Wed Jul 24 15:27:51 2013 +0200

    If we can't list sources, assume that the dependency hasn't changed.
    
    Fixes #1397.


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

473123e6d2cbfdcdd4e1a24be6f7bdf6a44bec05
 cabal-install/Distribution/Client/Sandbox/Timestamp.hs |   15 +++++++--------
 1 file changed, 7 insertions(+), 8 deletions(-)

diff --git a/cabal-install/Distribution/Client/Sandbox/Timestamp.hs b/cabal-install/Distribution/Client/Sandbox/Timestamp.hs
index c53eea5..11d6e37 100644
--- a/cabal-install/Distribution/Client/Sandbox/Timestamp.hs
+++ b/cabal-install/Distribution/Client/Sandbox/Timestamp.hs
@@ -17,7 +17,6 @@ module Distribution.Client.Sandbox.Timestamp (
   listModifiedDeps,
   ) where
 
-import Control.Exception                             (finally, onException)
 import Control.Monad                                 (filterM, forM, when)
 import Data.Char                                     (isSpace)
 import Data.List                                     (partition)
@@ -235,15 +234,15 @@ allPackageSourceFiles verbosity packageDir = inDir (Just packageDir) $ do
         srcs <- fmap lines . readFile $ file
         mapM tryCanonicalizePath srcs
 
-      cleanupAfterListSources, onFailedListSources :: IO ()
-      cleanupAfterListSources = removeExistingFile file
-      onFailedListSources     =
-        warn verbosity $ "Couldn't list sources of the package '"
-          ++ display (packageName pkg) ++ "'"
+      onFailedListSources :: IO ()
+      onFailedListSources = warn verbosity $
+          "Coud not list sources of the add-source dependency '"
+          ++ display (packageName pkg) ++ "'. Assuming that it wasn't changed."
 
   -- Run setup sdist --list-sources=TMPFILE
-  (doListSources `finally` cleanupAfterListSources)
-    `onException` onFailedListSources
+  ret <- doListSources `catchIO` (\_ -> onFailedListSources >> return [])
+  removeExistingFile file
+  return ret
 
 -- | Has this dependency been modified since we have last looked at it?
 isDepModified :: Verbosity -> EpochTime -> AddSourceTimestamp -> IO Bool





More information about the ghc-commits mailing list