[commit: packages/Cabal] ghc-head: Unbreak 'tryCanonicalizePath' on Windows. (0740fd8)

git at git.haskell.org git at git.haskell.org
Mon Aug 26 23:23:06 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=0740fd84c288b4544bfe2ea3dbab48f93cd5cacd

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

commit 0740fd84c288b4544bfe2ea3dbab48f93cd5cacd
Author: Mikhail Glushenkov <the.dead.shall.rise at gmail.com>
Date:   Mon Apr 29 23:22:58 2013 +0200

    Unbreak 'tryCanonicalizePath' on Windows.


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

0740fd84c288b4544bfe2ea3dbab48f93cd5cacd
 cabal-install/Distribution/Client/Utils.hs |    6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/cabal-install/Distribution/Client/Utils.hs b/cabal-install/Distribution/Client/Utils.hs
index 3f1d559..49c5f2c 100644
--- a/cabal-install/Distribution/Client/Utils.hs
+++ b/cabal-install/Distribution/Client/Utils.hs
@@ -27,7 +27,7 @@ import System.FilePath
 import System.IO.Unsafe ( unsafePerformIO )
 
 #if defined(mingw32_HOST_OS)
-import Control.Monad (liftM2, when)
+import Control.Monad (liftM2, unless)
 import System.Directory (doesDirectoryExist)
 #endif
 
@@ -138,8 +138,8 @@ tryCanonicalizePath :: FilePath -> IO FilePath
 tryCanonicalizePath path = do
   ret <- canonicalizePath path
 #if defined(mingw32_HOST_OS)
-  doesNotExist <- liftM2 (||) (doesFileExist ret) (doesDirectoryExist ret)
-  when doesNotExist $
+  exists <- liftM2 (||) (doesFileExist ret) (doesDirectoryExist ret)
+  unless exists $
     error $ ret ++ ": canonicalizePath: does not exist "
                 ++ "(No such file or directory)"
 #endif





More information about the ghc-commits mailing list