summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Build/Configure.hs2
-rw-r--r--Build/TestConfig.hs2
-rw-r--r--Build/Version.hs12
-rw-r--r--debian/changelog2
4 files changed, 9 insertions, 9 deletions
diff --git a/Build/Configure.hs b/Build/Configure.hs
index 4912122..e488ee1 100644
--- a/Build/Configure.hs
+++ b/Build/Configure.hs
@@ -12,7 +12,7 @@ import Git.Version
tests :: [TestCase]
tests =
- [ TestCase "version" getVersion
+ [ TestCase "version" (Config "packageversion" . StringConfig <$> getVersion)
, TestCase "git" $ requireCmd "git" "git --version >/dev/null"
, TestCase "git version" getGitVersion
]
diff --git a/Build/TestConfig.hs b/Build/TestConfig.hs
index 8628ebe..e55641f 100644
--- a/Build/TestConfig.hs
+++ b/Build/TestConfig.hs
@@ -7,8 +7,6 @@ import Utility.Monad
import Utility.SafeCommand
import System.IO
-import System.Cmd
-import System.Exit
import System.FilePath
import System.Directory
diff --git a/Build/Version.hs b/Build/Version.hs
index 98e0dbf..da9d1bb 100644
--- a/Build/Version.hs
+++ b/Build/Version.hs
@@ -10,10 +10,11 @@ import System.Directory
import Data.Char
import System.Process
-import Build.TestConfig
import Utility.Monad
import Utility.Exception
+type Version = String
+
{- Set when making an official release. (Distribution vendors should set
- this too.) -}
isReleaseBuild :: IO Bool
@@ -25,14 +26,14 @@ 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 Version
getVersion = do
changelogversion <- getChangelogVersion
- version <- ifM (isReleaseBuild)
+ ifM (isReleaseBuild)
( return changelogversion
, catchDefaultIO changelogversion $ do
let major = takeWhile (/= '.') changelogversion
- autoversion <- readProcess "sh"
+ autoversion <- takeWhile (\c -> isAlphaNum c || c == '-') <$> readProcess "sh"
[ "-c"
, "git log -n 1 --format=format:'%ci %h'| sed -e 's/-//g' -e 's/ .* /-g/'"
] ""
@@ -40,9 +41,8 @@ getVersion = do
then return changelogversion
else return $ concat [ major, ".", autoversion ]
)
- return $ Config "packageversion" (StringConfig version)
-getChangelogVersion :: IO String
+getChangelogVersion :: IO Version
getChangelogVersion = do
changelog <- readFile "debian/changelog"
let verline = takeWhile (/= '\n') changelog
diff --git a/debian/changelog b/debian/changelog
index 438a7ce..de5e1dc 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,6 +1,8 @@
git-repair (1.20141027) UNRELEASED; urgency=medium
* Adjust cabal file to support network-uri split.
+ * Merge Build/ from git-annex, including removing a use of deprecated
+ System.Cmd.
-- Joey Hess <joeyh@debian.org> Mon, 27 Oct 2014 11:06:23 -0400