diff options
author | Daniel Gröber <dxld@darkboxed.org> | 2015-08-07 09:58:15 +0200 |
---|---|---|
committer | Daniel Gröber <dxld@darkboxed.org> | 2015-08-07 09:58:15 +0200 |
commit | aca3c9fc6358cb2ebdcd2669c1262fca42b223bb (patch) | |
tree | 4329ea6b5bd90ddddb5a5114f601bce6e4af5f58 /CabalHelper | |
parent | 4fd4b1942c7ea33dc8fc7bc6586048c2d8b529c3 (diff) |
Work around `require-sandbox: True`
Diffstat (limited to 'CabalHelper')
-rw-r--r-- | CabalHelper/Wrapper.hs | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/CabalHelper/Wrapper.hs b/CabalHelper/Wrapper.hs index b827de6..ef20a2e 100644 --- a/CabalHelper/Wrapper.hs +++ b/CabalHelper/Wrapper.hs @@ -373,6 +373,7 @@ installCabal opts ver = do \Building Cabal %s ...\n" appdir sver sver sver db <- createPkgDb opts ver + cabalInstallVer <- cabalInstallVersion opts cabal_opts <- return $ concat [ [ "--package-db=clear" @@ -381,6 +382,9 @@ installCabal opts ver = do , "--prefix=" ++ db </> "prefix" , "--with-ghc=" ++ ghcProgram opts ] + , if cabalInstallVer >= Version [1,20,0,0] [] + then ["--no-require-sandbox"] + else [] , if ghcPkgProgram opts /= ghcPkgProgram defaultOptions then [ "--with-ghc-pkg=" ++ ghcPkgProgram opts ] else [] @@ -402,6 +406,10 @@ ghcPkgVersion :: Options -> IO Version ghcPkgVersion Options {..} = do parseVer . trim . dropWhile (not . isDigit) <$> readProcess ghcPkgProgram ["--version"] "" +cabalInstallVersion :: Options -> IO Version +cabalInstallVersion Options {..} = do + parseVer . trim <$> readProcess cabalProgram ["--numeric-version"] "" + trim :: String -> String trim = dropWhileEnd isSpace |