From 4268ede4f615770c2fb3468da2e1aece99ab8e60 Mon Sep 17 00:00:00 2001 From: Daniel Gröber Date: Sun, 31 Mar 2019 20:17:30 +0200 Subject: 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. --- src/CabalHelper/Compiletime/Cabal.hs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'src/CabalHelper/Compiletime/Cabal.hs') 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 -- cgit v1.2.3