add Build/BuildVersion, for use by autobuilders

This commit is contained in:
Joey Hess 2014-06-18 14:29:39 -04:00
parent af90a03178
commit a615817ab1
4 changed files with 11 additions and 5 deletions

View file

@ -25,10 +25,10 @@ isReleaseBuild = isJust <$> catchMaybeIO (getEnv "RELEASE_BUILD")
-
- If git or a git repo is not available, or something goes wrong,
- or this is a release build, just use the version from the changelog. -}
getVersion :: Test
getVersion :: IO String
getVersion = do
changelogversion <- getChangelogVersion
version <- ifM (isReleaseBuild)
ifM (isReleaseBuild)
( return changelogversion
, catchDefaultIO changelogversion $ do
let major = takeWhile (/= '.') changelogversion
@ -40,7 +40,6 @@ getVersion = do
then return changelogversion
else return $ concat [ major, ".", autoversion ]
)
return $ Config "packageversion" (StringConfig version)
getChangelogVersion :: IO String
getChangelogVersion = do