Skip to content

Commit

Permalink
Fixed bug which caused Cabal to guess the wrong HC-PKG path.
Browse files Browse the repository at this point in the history
  • Loading branch information
lemmih committed May 30, 2005
1 parent 70f9550 commit 044b0b8
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions Distribution/Simple/Configure.hs
Expand Up @@ -83,7 +83,7 @@ import Data.List (intersperse, nub, maximumBy, isPrefixOf)
import Data.Char (isSpace)
import Data.Maybe(fromMaybe)
import System.Directory
import Distribution.Compat.FilePath (splitFilePath, joinFileName, joinFileExt)
import Distribution.Compat.FilePath (splitFileName, joinFileName, joinFileExt)
import System.Cmd ( system )
import System.Exit ( ExitCode(..) )
import Control.Monad ( when, unless )
Expand Down Expand Up @@ -354,8 +354,8 @@ pCheck rs = [ r | (r,s) <- rs, all isSpace s ]
guessPkgToolFromHCPath :: Int -> CompilerFlavor -> FilePath -> IO FilePath
guessPkgToolFromHCPath verbose flavor path
= do let pkgToolName = compilerPkgToolName flavor
(dir,_,ext) = splitFilePath path
pkgtool = dir `joinFileName` pkgToolName `joinFileExt` ext
(dir,name) = splitFileName path
pkgtool = dir `joinFileName` pkgToolName ++ drop (length (compilerBinaryName flavor)) name
when (verbose > 0) $ message $ "looking for package tool: " ++ pkgToolName ++ " near compiler in " ++ path
exists <- doesFileExist pkgtool
when (not exists) $
Expand Down

0 comments on commit 044b0b8

Please sign in to comment.