1module Stackage.CheckCabalVersion
5import Control.Exception (assert)
6import Distribution.Text (simpleParse)
7import Distribution.Version (withinRange)
8import Prelude hiding (pi)
9import System.Process (readProcess)
11checkCabalVersion :: IO String
13 putStrLn "Checking Cabal version"
14 versionString <- readProcess "cabal" ["--version"] ""
16 case map words $ lines versionString of
17 [_,["using","version",libVersion,"of","the","Cabal","library"]] -> return libVersion
18 _ -> error "Did not understand cabal --version output"
20 case (simpleParse libVersion, simpleParse ">= 1.16") of
21 (Nothing, _) -> error $ "cabal binary reported an invalid Cabal library version: " ++ libVersion
22 (_, Nothing) -> assert False $ return ()
24 | v `withinRange` vr -> return ()
25 | otherwise -> error $ "cabal binary build against unsupported Cabal library version: " ++ libVersion
keysesc to close
- j k
- move down, up
- enter
- open
- esc
- back, or up a level
- 1 2 3 4
- readme, files, commits, refs
- /
- filter
- y
- copy the clone command
- c
- compare the chosen commit with another (or shift-click both)
- ?
- show or hide this list