aboutsummaryrefslogtreecommitdiff
path: root/src/CabalHelper/Compiletime
diff options
context:
space:
mode:
authorDaniel Gröber <dxld@darkboxed.org>2019-03-31 20:17:30 +0200
committerDaniel Gröber <dxld@darkboxed.org>2019-04-01 14:56:18 +0200
commit4268ede4f615770c2fb3468da2e1aece99ab8e60 (patch)
treeb693dc3a240eba44bc6bd58d75a6886770d2faa8 /src/CabalHelper/Compiletime
parent6d5ced6d2490793680f2b4344d102769774f3a87 (diff)
Don't insist on an odd major version in unpackCabalHEAD
Super-major version bumps like Cabal-2.5.0.0 -> Cabal-3.0.0.0 violate that rule.
Diffstat (limited to 'src/CabalHelper/Compiletime')
-rw-r--r--src/CabalHelper/Compiletime/Cabal.hs7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/CabalHelper/Compiletime/Cabal.hs b/src/CabalHelper/Compiletime/Cabal.hs
index 0a11ba3..3ffb670 100644
--- a/src/CabalHelper/Compiletime/Cabal.hs
+++ b/src/CabalHelper/Compiletime/Cabal.hs
@@ -210,9 +210,10 @@ unpackCabalHEAD tmpdir = do
-- If the released version of cabal has 4 components but we use only three
-- theirs will always be larger than this one here. That's not really
-- critical though.
- setVersion i (versionBranch -> mj:mi:_:_:[])
- | odd mi = Just $ makeVersion $ mj:mi:[i]
- setVersion _ _ = error "unpackCabalHEAD.setVersion: Wrong version format"
+ setVersion i (versionBranch -> mj:mi:_:_:[]) =
+ Just $ makeVersion $ mj:mi:[i]
+ setVersion _ v =
+ error $ "unpackCabalHEAD.setVersion: Wrong version format" ++ show v
-- | Replace the version declaration in a cabal file
replaceVersionDecl :: (Version -> Maybe Version) -> String -> Maybe String