Commit 131446f2 authored by Duncan Coutts's avatar Duncan Coutts
Browse files

Correct and simplify checkVersion

parent bc5bda3b
......@@ -664,13 +664,13 @@ checkCabalVersion pkg =
checkVersion :: [Int] -> Bool -> PackageCheck -> Maybe PackageCheck
checkVersion ver cond pc
| packageName pkg == PackageName "Cabal" = Nothing
| not (requiresAtLeast (Version ver []))
&& cond = Just pc
| otherwise = Nothing
| requiresAtLeast (Version ver []) = Nothing
| not cond = Nothing
| otherwise = Just pc
requiresAtLeast :: Version -> Bool
requiresAtLeast = case cabalVersionIntervals of
(LowerBound ver' _,_):_ -> (>= ver')
(LowerBound ver' _,_):_ -> (ver' >=)
_ -> const False
where cabalVersionIntervals = asVersionIntervals (descCabalVersion pkg)
......
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