Commit aa5c8104 authored by Duncan Coutts's avatar Duncan Coutts
Browse files

Check that the --prefix is always specified as an absolute path

Should eliminate confusion with doing: cabal configure --prefix=~/local
Instead use --prefix ~/local or --prefix=$HOME/local
parent 220091eb
......@@ -125,7 +125,7 @@ import System.Directory
import System.Exit
( ExitCode(..), exitWith )
import System.FilePath
( (</>) )
( (</>), isAbsolute )
import qualified System.Info
( compilerName, compilerVersion )
import System.IO
......@@ -415,6 +415,9 @@ configure (pkg_descr0, pbi) cfg
let dirs = absoluteInstallDirs pkg_descr lbi NoCopyDest
relative = prefixRelativeInstallDirs pkg_descr lbi
unless (isAbsolute (prefix dirs)) $ die $
"expected an absolute directory name for --prefix: " ++ prefix dirs
info verbosity $ "Using compiler: " ++ showCompilerId comp
info verbosity $ "Using install prefix: " ++ prefix dirs
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment