[commit: Cabal] master: When launching setup in another dir we must use an adjusted path (27136eb)
Ian Lynagh
igloo at earth.li
Fri Jun 24 01:56:41 CEST 2011
Repository : ssh://darcs.haskell.org//srv/darcs/packages/Cabal
On branch : master
http://hackage.haskell.org/trac/ghc/changeset/27136eb58b6fb3b24bdd6d77d4f4e3ed432001df
>---------------------------------------------------------------
commit 27136eb58b6fb3b24bdd6d77d4f4e3ed432001df
Author: Duncan Coutts <duncan at haskell.org>
Date: Wed Jul 30 14:31:49 2008 +0000
When launching setup in another dir we must use an adjusted path
The path to the binary we're running must be accessable from
that other directory. The fix is to use currentDir </> setup
>---------------------------------------------------------------
cabal-install/Distribution/Client/SetupWrapper.hs | 5 +++--
1 files changed, 3 insertions(+), 2 deletions(-)
diff --git a/cabal-install/Distribution/Client/SetupWrapper.hs b/cabal-install/Distribution/Client/SetupWrapper.hs
index cb16590..c7037e9 100644
--- a/cabal-install/Distribution/Client/SetupWrapper.hs
+++ b/cabal-install/Distribution/Client/SetupWrapper.hs
@@ -54,7 +54,7 @@ import Distribution.Text
import Distribution.Verbosity
( Verbosity )
-import System.Directory ( doesFileExist, getModificationTime )
+import System.Directory ( doesFileExist, getModificationTime, getCurrentDirectory )
import System.FilePath ( (</>), (<.>) )
import System.IO.Error ( isDoesNotExistError )
import System.IO ( Handle )
@@ -281,7 +281,8 @@ externalSetupMethod verbosity options pkg bt mkargs = do
Just logHandle -> do
info verbosity $ unwords (setupProgFile : args)
info verbosity $ "Redirecting build log to " ++ show logHandle
- process <- runProcess setupProgFile args
+ currentDir <- getCurrentDirectory
+ process <- runProcess (currentDir </> setupProgFile) args
(useWorkingDir options) Nothing
Nothing (Just logHandle) (Just logHandle)
exitCode <- waitForProcess process
More information about the Cvs-libraries
mailing list