diff options
author | Sean Whitton <spwhitton@spwhitton.name> | 2020-01-02 18:07:10 +0000 |
---|---|---|
committer | Sean Whitton <spwhitton@spwhitton.name> | 2020-01-02 18:07:10 +0000 |
commit | 1092316ba04116d7ae1d4cdf347804feacef768a (patch) | |
tree | fbc819794d4202a4ac778f0f6be57eedef7518dd /Build/Version.hs | |
parent | d1e0531dd8e8b842349421a898b74b212d2157e8 (diff) | |
parent | 50a5a7b101cc9c30a5a04b4c20cbf7f99fcab0ef (diff) | |
download | git-repair-1092316ba04116d7ae1d4cdf347804feacef768a.tar.gz |
Merge tag '1.20200102'
tagging package git-repair version 1.20200102
Diffstat (limited to 'Build/Version.hs')
-rw-r--r-- | Build/Version.hs | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/Build/Version.hs b/Build/Version.hs index da9d1bb..d39a0fe 100644 --- a/Build/Version.hs +++ b/Build/Version.hs @@ -1,24 +1,26 @@ {- Package version determination, for configure script. -} +{-# OPTIONS_GHC -fno-warn-tabs #-} + module Build.Version where -import Data.Maybe -import Control.Applicative import Data.List import System.Environment -import System.Directory import Data.Char import System.Process +import Control.Applicative +import Prelude import Utility.Monad import Utility.Exception +import Utility.Directory type Version = String {- Set when making an official release. (Distribution vendors should set - this too.) -} isReleaseBuild :: IO Bool -isReleaseBuild = isJust <$> catchMaybeIO (getEnv "RELEASE_BUILD") +isReleaseBuild = (== Just "1") <$> catchMaybeIO (getEnv "RELEASE_BUILD") {- Version is usually based on the major version from the changelog, - plus the date of the last commit, plus the git rev of that commit. @@ -44,7 +46,7 @@ getVersion = do getChangelogVersion :: IO Version getChangelogVersion = do - changelog <- readFile "debian/changelog" + changelog <- readFile "CHANGELOG" let verline = takeWhile (/= '\n') changelog return $ middle (words verline !! 1) where |